Rotation matrix

From Citizendium - Reading time: 11 min


This article is developing and not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.

In mathematics and physics a rotation matrix is synonymous with a 3×3 orthogonal matrix, which is a matrix R satisfying

𝐑T=𝐑1,

where T stands for the transposed matrix and R−1 is the inverse of R.

Connection of an orthogonal matrix to a rotation[edit]

In general a motion of a rigid body (which is equivalent to an angle and distance preserving transformation of affine space) can be described as a translation of the body followed by a rotation. By a translation all points of the space are displaced, while under a rotation at least one point stays in place. Let the the fixed point be O. By Euler's theorem follows that then not only the point is fixed but also an axis—the rotation axis— through the fixed point. Write n^ for the unit vector along the rotation axis and φ for the angle over which the body is rotated, then the rotation operator on 3 is written as (φ,n^).

Erect three Cartesian coordinate axes with the origin in the fixed point O and take unit vectors e^x,e^y,e^z along the axes, then the 3×3 rotation matrix 𝐑(φ,n^) is defined by its elements Rji(φ,n^) :

(φ,n^)(e^i)=j=x,y,xe^jRji(φ,n^)fori=x,y,z.

In a more condensed notation this equation can be written as

(φ,n^)(e^x,e^y,e^z)=(e^x,e^y,e^z)𝐑(φ,n^).

Given a basis of a linear space, the association between a linear map and its matrix is one-to-one.

Since a rotation (for convenience sake the rotation axis and angle are suppressed in the notation) leaves all angles and distances invariant, for any pair of vectors a and b in 3 the inner product is invariant, that is,

((a),(b))=(a,b).

A linear map with this property is called orthogonal. It is easily shown that a similar vector-matrix relation holds. First we define column vectors (stacked triplets of real numbers given in bold face):

a=(e^x,e^y,e^z)(axayaz)=def(e^x,e^y,e^z)𝐚andb=(e^x,e^y,e^z)(bxbybz)=def(e^x,e^y,e^z)𝐛

and observe that the inner product becomes by virtue of the orthonormality of the basis vectors

(a,b)=𝐚T𝐛(ax,ay,az)(bxbybz)axbx+ayby+azbz.

The invariance of the inner product under the rotation operator leads to

𝐚T𝐛=(𝐑𝐚)T𝐑𝐛=𝐚T𝐑T𝐑𝐛,

since this holds for any pair a and b it follows that a rotation matrix satisfies

𝐑T𝐑=𝐄,

where E is the 3×3 identity matrix. For finite-dimensional matrices one shows easily

𝐑T𝐑=𝐄𝐑𝐑T=𝐄.

A matrix with this property is called orthogonal. So, a rotation gives rise to a unique orthogonal matrix.

Conversely, consider an arbitrary point P in the body and let the vector OP connect the fixed point O with P. Expressing this vector with respect to a Cartesian frame in O gives the column vector p (three stacked real numbers). Multiply p by the orthogonal matrix R, then p′ = Rp represents the rotated point P′ (or, more precisely, the vector OP is represented by column vector p′ with respect to the same Cartesian frame). If we map all points P of the body by the same matrix R in this manner, we have rotated the body. Thus, an orthogonal matrix leads to a unique rotation. Note that the Cartesian frame is fixed here and that points of the body are rotated, this is known as an active rotation. Instead, the rigid body could have been left invariant and the Cartesian frame could have been rotated, this also leads to new column vectors of the form p′ ≡ Rp, such rotations are called passive.

Properties of an orthogonal matrix[edit]

Writing out matrix products it follows that both the rows and the columns of the matrix are orthonormal (normalized and orthogonal). Indeed,

𝐑T𝐑=𝐄k=13RkiRkj=δij(columns)𝐑𝐑T=𝐄k=13RikRjk=δij(rows)

where δij is the Kronecker delta.

Orthogonal matrices come in two flavors: proper (det = 1) and improper (det = −1) rotations. Indeed, invoking some properties of determinants, one can prove

1=det(𝐄)=det(𝐑T𝐑)=det(𝐑T)det(𝐑)=det(𝐑)2det(𝐑)=±1.

Compact notation[edit]

A compact way of presenting the same results is the following. Designate the columns of R by r1, r2, r3, i.e.,

𝐑=(𝐫1,𝐫2,𝐫3).

The matrix R is orthogonal if

𝐫iT𝐫j𝐫i𝐫j=δij,i,j=1,2,3.

The matrix R is a proper rotation matrix, if it is orthogonal and if r1, r2, r3 form a right-handed set, i.e.,

𝐫i×𝐫j=k=13εijk𝐫k.

Here the symbol × indicates a cross product and εijk is the antisymmetric Levi-Civita symbol,

ε123=ε312=ε231=1ε213=ε321=ε132=1

and εijk=0 if two or more indices are equal.

The matrix R is an improper rotation matrix if its column vectors form a left-handed set, i.e.,

𝐫i×𝐫j=k=13εijk𝐫k.

The last two equations can be condensed into one equation

𝐫i×𝐫j=det(𝐑)k=13εijk𝐫k

by virtue of the the fact that the determinant of a proper rotation matrix is 1 and of an improper rotation −1. This was proved above, an alternative proof is the following: The determinant of a 3×3 matrix with column vectors a, b, and c can be written as scalar triple product

det(𝐚,𝐛,𝐜)=𝐚(𝐛×𝐜).

It was just shown that for a proper rotation the columns of R are orthonormal and satisfy,

𝐫1(𝐫2×𝐫3)=𝐫1(k=13ε23k𝐫k)=ε231=1.

Likewise the determinant is −1 for an improper rotation.

Explicit expression of rotation operator[edit]

CC Image
Rotation of vector r around axis n^ over an angle φ. The red vectors are in the plane of drawing spanned by r and n^. The blue vectors are rotated, the green cross product points away from the reader and is perpendicular to the plane of drawing.

Let OPr be a vector pointing from the fixed point O of a rigid body to an arbitrary point P of the body. A rotation of this arbitrary vector around the unit vector n^ over an angle φ can be written as

(φ,n^)(r)r=rcosφ+n^(n^r)(1cosφ)+(n^×r)sinφ.

where • indicates an inner product and the symbol × a cross product.

It is easy to derive this result. Indeed, decompose the vector to be rotated into two components, one along the rotation axis and one perpendicular to it (see the figure on the right)

r=r+rwithr=n^(n^r),r=rn^(n^r).

Upon rotation the component along the axis is invariant, only the component orthogonal to the axis changes. By virtue of the fact that

|r|=|n^×r|=|r|2(n^r)2,

the rotation property simply is

rr'=cosφr+sinφ(n^×r).

Hence

r=[r(n^r)n^]cosφ+(n^×r)sinφ+n^(n^r).

Some reshuffling of the terms gives the required result.

Explicit expression of rotation matrix[edit]

It will be shown that

𝐑(φ,n^)=𝐄+sinφ𝐍+(1cosφ)𝐍2,

where (see cross product for more details)

𝐍(0nznynz0nxnynx0)andn^(e^x,e^y,e^z)(nxnynz)(e^x,e^y,e^z)𝐧^

Note further that the dyadic product satisfies (as can be shown by squaring N),

𝐧^𝐧^=𝐍2+𝐄,with|𝐧^|=1

and that

n^(n^r)(𝐧^𝐧^)𝐫=(𝐍2+𝐄)𝐫.

Translating the result of the previous section to coordinate vectors and substituting these results gives

𝐫=[cosφ𝐄+(1cosφ)(𝐍2+𝐄)+sinφ𝐍]𝐫=[𝐄+(1cosφ)𝐍2+sinφ𝐍]𝐫,(1)

which gives the desired result for the rotation matrix. This equation is identical to Eq. (2.6) of Biedenharn and Louck[1], who give credit to Leonhard Euler (ca. 1770) for this result.

For the special case φ = π (rotation over 180°), equation (1) can be simplified to

𝐑(π,n^)=𝐄+2𝐍2=𝐄+2𝐧^𝐧^

so that

𝐑(π,n^)𝐫=𝐫+2𝐧^(𝐧^𝐫),

which sometimes[2] is referred to as reflection over a line, although it is not a reflection.

Equation (1) is a special case of the transformation properties given on p. 7 of the classical work (first edition 1904) of Whittaker[3]. To see the correspondence with Whittaker's formula, which includes also a translation over a displacement d and who rotates the vector (xa, yb, zc), we must put equal to zero: a, b, c, and d in Whittaker's equation. Furthermore Whittaker uses that the components of the unit vector n are the direction cosines of the rotation axis:

nxcosα,nycosβ,nzcosγ.

Under these conditions the rotation becomes

x=x(1cosφ)[xsin2αycosαcosβzcosαcosγ]+[zcosβycosγ]sinφy=y(1cosφ)[ysin2βzcosβcosγxcosβcosα]+[xcosγzcosα]sinφz=z(1cosφ)[zsin2γxcosγcosαycosγcosβ]+[ycosαxcosβ]sinφ

Vector rotation[edit]

Sometimes it is necessary to rotate a rigid body so that a given vector in the body (for instance an oriented chemical bond in a molecule) is lined-up with an external vector (for instance a vector along a coordinate axis).

Let the vector in the body be f (the "from" vector) and the vector to which f must be rotated be t (the "to" vector). Let both vectors be unit vectors (have length 1). From the definition of the inner product and the cross product follows that

𝐟𝐭=cosφ,|𝐟×𝐭|=sinφ,

where φ is the angle (< 180°) between the two vectors. Since the cross product f × t is a vector perpendicular to the plane of both vectors, it is easily seen that a rotation around the cross product vector over an angle φ moves f to t.

Write

𝐮=𝐟×𝐭𝐮=sinφ𝐧^,

where 𝐧^ is a unit vector. Define accordingly

𝐔=defsinφ𝐍=sinφ(0nznynz0nxnynx0)=(0uzuyuz0uxuyux0),

so that

𝐑(φ,n^)=𝐄+𝐔+1cosφsin2φ𝐔2=𝐄+𝐔+11+cosφ𝐔2(2)=cosφ𝐄+𝐔+11+cosφ𝐮𝐮

The last equation, which follows from U2 = uu − sin2φ E, is Eq. (3) of Ref. [4] after substitution of

1cosφsin2φ=1cosφ1cos2φ=11+cosφ.

Indeed, write the rotation matrix in full, using the short-hand notations c = cos φ and h = (1-c)/(1-c2)

𝐑(φ,n^)=(c+hux2huxuyuzhuxuz+uyhuxuy+uzc+huy2huyuzuxhuxuzuyhuyuz+uxc+huz2),

which is the matrix in Eq. (3) of Ref. [4]. If the vectors are parallel, f = t, then u = 0, U = 0 and ft = cosφ = 1, so that the equation is well-defined—it gives R(φ, n) = E, as expected. Provided f and t are not anti-parallel, the matrix 𝐑(φ,n^) can be computed easily and quickly. It requires not much more than the computation of the inner and cross product of f and t.

Case that "from" and "to" vectors are anti-parallel[edit]

If the vectors f and t are nearly anti-parallel, f ≈ − t, then ft = cosφ ≈ − 1, and the denominator in Eq. (2) becomes zero, so that Eq. (2) is not applicable. The vector defining the rotation axis is nearly zero: uf × tf × (−f) ≈ 0.

Clearly, a two-fold rotation (angle 180°) around any rotation axis perpendicular to f will map f onto −f. This freedom in choice of the two-fold axis is consistent with the indeterminacy in the equation that occurs for cosφ = −1.

Since −E (inversion) sends f to −f, one could naively assume that all position vectors of the rigid body may be inverted by −E. However, if the rigid body is not symmetric under inversion (does not have a symmetry center), inversion turns the body into a non-equivalent one. For instance, if the body is a right-hand glove, inversion sends it into a left-hand glove; it is well-known that a right-hand and a left-hand glove are different.

Recall that f is a unit vector. If f is on the z-axis, |fz| = 1, then the following rotation around the y-axis turns f into −f:

𝐑(π,e^y)𝐟=(100010001)(00±1)=(001)

If f is not on the z-axis, fz ≠ 1, then the following orthogonal matrix sends f to −f and hence gives a 180° rotation of the rigid body

𝐑(π,e^y)𝐟=11fz2((fx2fy2)2fxfy02fxfy(fx2fy2)000(1fz2))(fxfyfz)=(fxfyfz)

To show this we insert

𝐧^=11fz2(fyfx0)

into the expression for rotation over 180° introduced earlier:

𝐑(π,e^y)=𝐄+2𝐧^𝐧^.

Note that the vector 𝐧^ is normalized, because f is normalized, and that it lies in the x-y plane normal to the plane spanned by the z-axis and f; it is in fact a unit vector along a rotated y-axis obtained by rotation around the z-axis.

Given f = (fx, fy, fz), the matrix 𝐑(π,e^y) is easily and quickly calculated. The matrix rotates the body over 180° sending f to −f exactly. When −f and t are close, but not exactly equal, the earlier rotation formula Eq. (2), may be used to perform the final (small) rotation of the body that lets −f and t coincide exactly.

Change of rotation axis[edit]

Euler's theorem states that a rotation is characterized by a unique axis (an eigenvector with unit eigenvalue) and a unique angle. As a corollary of the theorem follows that the trace of a rotation matrix is equal to

Tr[𝐑(φ,n^)]=2cosφ+1,

and hence the trace depends only on the rotation angle and is independent of the axis. Let A be an orthogonal 3×3 matrix (not equal to E), then, because cyclic permutation of matrices under the trace is allowed (i.e., leaves the trace invariant),

Tr[𝐀𝐑(φ,n^)𝐀T]=Tr[𝐑(φ,n^)𝐀T𝐀]=Tr[𝐑(φ,n^)].

As a consequence it follows that the two matrices

𝐑(φ,n^)and𝐀𝐑(φ,n^)𝐀T

describe a rotation over the same angle φ but around different axes. The eigenvalue equation can be transformed

𝐑(φ,n^)n^=n^(𝐀𝐑(φ,n^)𝐀T)𝐀n^=𝐀n^

which shows that the transformed eigenvector is the rotation axis of the transformed matrix, or

𝐑(φ,𝐀n^)=𝐀𝐑(φ,n^)𝐀T.

References[edit]

  1. L. C. Biedenharn and J. D. Louck, Angular Momentum in Quantum Physics, Addison-Wesley, Reading, Mass. (1981) ISBN 0-201-13507-8
  2. Mathematics Enhancement Programme. “Matrices and Transformations”, Further Pure Mathematics. Centre for Innovation in Mathematics Teaching, 235-272. 
  3. E. T. Whittaker, A Treatise on the Dynamics of Particles and Rigid Bodies, Cambridge University Press (1965)
  4. 4.0 4.1 T. Möller and J. F. Hughes, J. Graphics Tools, 4 pp. 1–4 (1999).

Licensed under CC BY-SA 3.0 | Source: https://citizendium.org/wiki/Rotation_matrix
24 views | Status: cached on November 24 2025 10:12:49
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF