transformation rules in rotation matrices
TRANSCRIPT
-
8/11/2019 Transformation Rules in Rotation Matrices
1/18
Rotation matrixFrom Wikipedia, the free encyclopedia
In linear algebra, a rotation matrixis a matrix that is used to perform a rotation in Euclidean space. For example the matrix
rotates pointsin thexy-Cartesian plane counter-clockwise through an angle about the origin of the Cartesian coordinate system. o perform therotation using a rotation matrixR, the position of each point must be represented by a column !ector v, containing the coordinates of the point. "
rotated !ector is obtained by using the matrix multiplicationRv.
#otation matrices also pro!ide a means of numerically representing an arbitrary rotation of the axes about the origin, without appealing to angular
specification. hese coordinate rotations are a natural way to express the orientation of a camera, or the attitude of a spacecraft, relati!e to a
reference axes-set. $nce an obser!ational platform%s localX-Y-Zaxes are expressed numerically as three direction !ectors in world coordinates,
they together comprise the columns of the rotation matrixR&world ' platform( that transforms directions &expressed in world coordinates( intoe)ui!alent directions expressed in platform-local coordinates.
he examples in this article apply to rotation of vectors anti-clockwisein a right-handed systembypre-multiplication. If any one of these is
changed &e.g. rotating axes instead of !ectors(, then the transpose of the example matrix should be used.
*ince matrix multiplication has no effect on the +ero !ector &the coordinates of the origin(, rotation matrices can only be used to describe rotations
about the origin of the coordinate system. #otation matrices pro!ide an algebraic description of such rotations, and are used extensi!ely forcomputations in geometry, physics, and computer graphics.
#otation matrices are s)uare matrices, with real entries. ore specifically they can be characteri+ed as orthogonal matrices with determinant ,
.
In some literature, the term rotationis generali+ed to include improper rotations, characteri+ed by orthogonal matrices with determinant
&instead of /(. hese combine properrotations with reflections&which in!ert orientation(. In other cases, where reflections are not being
considered, the labelpropermay be dropped. his con!ention is followed in this article.
he set of all orthogonal matrices of si+e nwith determinant / forms a group known as the special orthogonal group *$&n(. he set of all
orthogonal matrices of si+e nwith determinant / or - forms the &general( orthogonal group $&n(.
Contents
In two dimensions
. 0on-standard orientation of the coordinate system
.1 Common rotations
1 In three dimensions
1. 2asic rotations
1.1 3eneral rotations
1.4 Con!ersion from and to axis-angle
1.4. 5etermining the axis
1.4.1 5etermining the angle
1.4.4 #otation matrix from axis and angle
4 6roperties of a rotation matrix
7 Examples
8 3eometry
9 ultiplication
: "mbiguities
; 5ecompositions
;. Independent planes
;.1 *e)uential angles
;.4 0ested dimensions
;.7 *kew parameters !ia Cayley%s formula
;.8 5ecomposition into shears
< 3roup theory
6age of ;#otation matrix - Wikipedia, the free encyclopedia
-??en.wikipedia.org?wiki?#otation@matrix
-
8/11/2019 Transformation Rules in Rotation Matrices
2/18
A counterclockwise rotation of a
vector through angle . The vector is
initially aligned with thex-axis.
A rotation through angle with non-standard axes.
9.1 Lie group
9.2 Lie algebra
9. !xponential "ap
9.# $aker%&a"pbell%'ausdorff for"ula
9.( )pin group
9.* +nfinitesi"al rotations
1, &onversions 1,.1 uaternion
1,.2 olar deco"position
1,. Axis and angle
1,.# !uler angles
11 /nifor" rando" rotation "atrices
12 )ee also
1 0otes
1# eferences
1( !xternal links
In two dimensions
+n two di"ensions every rotation "atrix has the following for"
.
This rotates colu"n vectors by "eans of the following "atrix "ultiplication
.
)o the coordinates 3x',y'4 of the point 3x,y4 after rotation are
.
The direction of vector rotation is counterclockwise if is positive 3e.g. 9,54 and clockwise if isnegative 3e.g. 69,54. Thus the clockwise rotation "atrix is found as
.
0ote that the two-di"ensional case is the only non-trivial 3e.g. one di"ension4 case where the rotation "atrices group is co""utative so that it
does not "atter the order in which "ultiple rotations are perfor"ed. An alternative convention uses rotating axes 718and the above "atrix also
represents a rotation of the axes clockwise through an angle .
Non-standard orientation of the coordinate system
+f a standard right-handed &artesian coordinate syste" is used with thexaxis to the right and theyaxis
up the rotationR34is counterclockwise. +f a left-handed &artesian coordinate syste" is used withx
directed to the right butydirected downR34is clockwise. )uch non-standard orientations are rarely usedin "athe"atics but are co""on in 2 co"puter graphics which often have the origin in the top left corner
and they-axis down the screen or page.728
)ee below for other alternative conventions which "ay change the sense of the rotation produced by a
rotation "atrix.
Common rotations
articularly useful are the "atrices for 9,5 and 1:,5 rotations
39,5 counterclockwise rotation4
age 2 of 1:otation "atrix - ;ikipedia the free encyclopedia
11-9-2,1#http"atrix
-
8/11/2019 Transformation Rules in Rotation Matrices
3/18
(180 rotation in either direction a half-turn)
(270 counterclockwise rotation, the same as a 90 clockwise rotation)
In three dimensions
Basic rotations
A asic rotation (also called elemental rotation) is a rotation aout one of the a!es of a "oordinate s#stem$ %he followin& three asic rotation
matrices rotate 'ectors # an an&le aout thex,y, ora!is, in three dimensions, usin& the ri&ht hand rule$ (%he same matrices can also reresent a
clockwise rotation of the a!es*+)
or column 'ectors, each of these asic 'ector rotations aears counter-clockwise when the a!is aout which the# occur oints toward the
oser'er, the coordinate s#stem is ri&ht-handed, and the an&le is ositi'e$ ., for instance, would rotate toward they-a!is a 'ector ali&ned with
thex-a!is, as can easil# e checked # oeratin& with .on the 'ector (1,0,0)/
%his is similar to the rotation roduced # the ao'e mentioned 2- rotation matri!$ ee elow for alternati'e con'entions which ma# aarentl#
or actuall# in'ert the sense of the rotation roduced # these matrices$
General rotations
ther rotation matrices can e otained from these three usin& matri! multilication$ or e!amle, the roduct
reresents a rotation whose #aw, itch, and roll an&les are !,", and #, resecti'el#$ 3ore formall#, it is an intrinsic rotation whose %ait-4r#an
an&les are !,", #, aout a!es,y,xresecti'el#$ imilarl#, the roduct
reresents an e!trinsic rotation whose 5uler an&les are !,", #aout a!esy,x,y$
%hese matrices roduce the desired effect onl# if the# are used to re-multil# column 'ectors (see Ami&uities for more details)$
Conversion from and to axis-angle
5'er# rotation in three dimensions is defined # its axis6 a direction that is left fi!ed # the rotation 6 and its angle6 the amount of rotation
aout that a!is (5uler rotation theorem)$
%here are se'eral methods to comute an a!is and an an&le from a rotation matri! (see also a!is-an&le)$ ere, we onl# descrie the method ased
on the comutation of the ei&en'ectors and ei&en'alues of the rotation matri!$ t is also ossile to use the trace of the rotation matri!$
Determining the axis
i'en a *!* rotation matri!R, a 'ector uarallel to the rotation a!is must satisf#
:a&e * of 18otation matri! - ;ikiedia, the free enc#cloedia
11-9-201matri!
-
8/11/2019 Transformation Rules in Rotation Matrices
4/18
A rotationRaround axis ucan be
decomposed using 3 endomorphisms
P, (I P), and Q(click to enlarge).
since the rotation of uaround the rotation axis must result in u. The equation above may be solved for u
hich is unique up to a scalar factor.
!urther, the equation may be reritten
hich shos that uis the null space ofR $ %.
"ieed in another ay, uis an eigenvector ofRcorresponding to the eigenvalue $. %very rotationmatrix must have this eigenvalue.
Determining the angle
To find the angle of a rotation, once the axis of the rotation is knon, select a vector vperpendicular to the
axis. Then the angle of the rotation is the angle beteen vandRv.
A much easier method, hoever, is to calculate the trace(i.e. the sum of the diagonal elements of the
rotation matrix) hich is $&'cos. are should be taken to select the right sign for the angle to match the
chosen axis.
Rotation matrix from axis and angle
!or some applications, it is helpful to be able to make a rotation ith a given axis. iven a unit vector u# (ux, uy, u), here ux'& uy
'& u'# $, the
matrix for a rotation by an angle of about an axis in the direction of uis
*+
This can be ritten more concisely as
here is the cross product matrix of u, is the tensor product and%is the -dentity matrix. This is a matrix form of odrigues/ rotation
formula, ith
-f the 30 space is right1handed, this rotation ill be counterclockise for an observer placed so that the axis ugoes in her direction (ight1hand
rule).
Properties of a rotation matrix
-n three dimensions, for any rotation matrix acting on , here ais a rotation axis and 2 a rotation angle,
(i.e., is an orthogonal matrix)
(i.e, the determinant of is $)
(here is the identity matrix)
The eigenvalues of are
here iis the standard imaginary unit ith the property
The trace of is equivalent to the sum of its eigenvalues.
ome of these properties can be generalised to any number of dimensions. -n other ords, they hold for any rotation matrix .
!or instance, in to dimensions the properties hold ith the folloing exceptions4
ais not a given axis, but a point (rotation center) hich must coincide ith the origin of the coordinate system in hich the rotation is
represented.
5age + of $6otation matrix 1 7ikipedia, the free encyclopedia
$$181'9$+http4::en.ikipedia.org:iki:otation;matrix
-
8/11/2019 Transformation Rules in Rotation Matrices
5/18
Consequently, the four elements of the rotation matrix depend only on , hence we write , rather than
The eigenvalues of are
The trace of is equivalent to the sum of its eigenvalues.
Examples
The 22 rotation matrix
corresponds to a 9! planar rotation.
The transpose of the 22 matrix
is its inverse, "ut since its determinant is #$, this is not a rotation
matrix% it is a reflection across the line $$y& 2x.
The '' rotation matrix
corresponds to a #'! rotation around thexaxis in three(
dimensional space.
The '' rotation matrix
corresponds to a rotation of approximately #)*! around the axis
+#$',2',
2'- in three(dimensional space.
The '' permutation matrix
is a rotation matrix, as is the matrix of any even permutation, androtates through $2! a"out the axisx&y&.
The '' matrix
has determinant $, "ut its transpose is not its inverse, so it is not
a rotation matrix.
The *' matrix
is not square, and so cannot "e a rotation matrix% yet(yields a
'' identity matrix +the columns are orthonormal-.
The ** matrix
descri"es an isoclinic rotation, a rotation through equal angles
+$/!- through two orthogonal planes.
The 00 rotation matrix
rotates vectors in the plane of the first two coordinate axes 9!,
rotates vectors in the plane of the next two axes $/!, and leaves
the last coordinate axis unmoved.
Geometry
1n uclidean geometry, a rotation is an example of an isometry, a transformation that moves points without changing the distances "etween them.
3otations are distinguished from other isometries "y two additional properties4 they leave +at least- one point fixed, and they leave 5handedness5
unchanged. 6y contrast, a translation moves every point, a reflection exchanges left( and right(handed ordering, and a glide reflection does "oth.
7 rotation that does not leave 5handedness5 unchanged is an improper rotation or a rotoinversion.
1f we ta8e the fixed point as the origin of a Cartesian coordinate system, then every point can "e given coordinates as a displacement from the
origin. Thus we may wor8 with the vector space of displacements instead of the points themselves. ow suppose +p$,:,pn- are the coordinates of
the vector pfrom the origin, ), to point*. Choose an orthonormal "asis for our coordinates% then the squared distance to*, "y ;ythagoras, is
;age 0 of $/3otation matrix ( matrix
-
8/11/2019 Transformation Rules in Rotation Matrices
6/18
which we can compute using the matrix multiplication
A geometric rotation transforms lines to lines, and preserves ratios of distances between points. From these properties we can show that a rotation
is a linear transformation of the vectors, and thus can be written in matrix form, Qp. The fact that a rotation preserves, not just ratios, but distances
themselves, we can state as
or
Because this equation holds for all vectors, p, we conclude that every rotation matrix, Q, satisfies the orthogonalitycondition,
otations preserve handedness because they cannot change the ordering of the axes, which implies thespecial matrixcondition,
!qually important, we can show that any matrix satisfying these two conditions acts as a rotation.
Multiplication
The inverse of a rotation matrix is its transpose, which is also a rotation matrix"
The product of two rotation matrices is a rotation matrix"
For ngreater than #, multiplication of n$nrotation matrices is not commutative.
%oting that any identity matrix is a rotation matrix, and that matrix multiplication is associative, we may summari&e all these properties by saying
that the n$nrotation matrices form a group, which for n' # is non(abelian. )alled a special orthogonal group, and denoted by *+n-, *+n,R-,*+n, or *+nR-, the group of n$nrotation matrices is isomorphic to the group of rotations in an n-dimensional space. This means that
multiplication of rotation matrices corresponds to composition of rotations, applied in left(to(right order of their corresponding matrices.
Ambiguities
The interpretation of a rotation matrix can be subject to many ambiguities.
n most cases the effect of the ambiguity is equivalent to the effect of a rotation matrix inversion for these orthogonal matrices equivalently
matrix transpose-.
Alias or alibi (passive or active) transformation
The coordinates of a pointPmay change due to either a rotation of the coordinate system CSalias-, or a rotation of the pointPalibi-. n
the latter case, the rotation ofPalso produces a rotation of the vector vrepresentingP. n other words, eitherPand vare fixed while CS
rotates alias-, or CSis fixed whilePand vrotate alibi-. Any given rotation can be legitimately described both ways, as vectors andcoordinate systems actually rotate with respect to each other, about the same axis but in opposite directions. Throughout this article, we
chose the alibi approach to describe rotations. For instance,
/age 0 of 12otation matrix ( 3i4ipedia, the free encyclopedia
11(5(#617http"88en.wi4ipedia.org8wi4i8otation9matrix
-
8/11/2019 Transformation Rules in Rotation Matrices
7/18
Alias and alibi rotations
represents a counterclockwise rotation of a vector vby an angle , or a rotation
of CSby the same angle but in the opposite direction (i.e. clockwise). Alibi and
alias transformations are also known as active and passive transformations,
respectively.
Pre-multiplication or post-multiplicationThe same pointPcan be represented either by a column vector vor a row vector
w. Rotation matrices can either pre-multiply column vectors (Rv), or post-
multiply row vectors (wR). owever,Rvproduces a rotation in the opposite
direction with respect to wR. Throughout this article, we described rotations
produced on column vectors by means of a pre-multiplication. To obtain e!actly
the same rotation (i.e. the same final coordinates of pointP), the row vector must be post-multiplied by the transpose of R (wRT).
Right- or left-handed coordinates
The matri! and the vector can be represented with respect to a right-handed or left-handed coordinate system. Throughout the article, we
assumed a right-handed orientation, unless otherwise specified.
Vectors or forms
The vector space has a dual space of linear forms, and the matri! can act on either vectors or forms.
Decompositions
Independent planes
"onsider the #$# rotation matri!
%f Qacts in a certain direction, v, purely as a scaling by a factor &, then we have
so that
Thus & is a root of the characteristic polynomial for Q,
Two features are noteworthy. 'irst, one of the roots (or eigenvalues) is , which tells us that some direction is unaffected by the matri!. 'or
rotations in three dimensions, this is the axisof the rotation (a concept that has no meaning in any other dimension). econd, the other two roots
are a pair of comple! con*ugates, whose product is (the constant term of the +uadratic), and whose sum is cos (the negated linear term). This
factoriation is of interest for #$# rotation matrices because the same thing occurs for all of them. (As special cases, for a null rotation the/comple! con*ugates/ are both , and for a 012 rotation they are both 3.) 'urthermore, a similar factoriation holds for any n$nrotation matri!.
%f the dimension, n, is odd, there will be a /dangling/ eigenvalue of 4 and for any dimension the rest of the polynomial factors into +uadratic
terms like the one here (with the two special cases noted). 5e are guaranteed that the characteristic polynomial will have degree nand thus n
eigenvalues. And since a rotation matri! commutes with its transpose, it is a normal matri!, so can be diagonalied. 5e conclude that every
rotation matri!, when e!pressed in a suitable coordinate system, partitions into independent rotations of two-dimensional subspaces, at most n6of
them.
The sum of the entries on the main diagonal of a matri! is called the trace4 it does not change if we reorient the coordinate system, and always
e+uals the sum of the eigenvalues. This has the convenient implication for $ and #$# rotation matrices that the trace reveals the angle of
rotation, , in the two-dimensional (sub-)space. 'or a $ matri! the trace is cos(), and for a #$# matri! it is 7 cos(). %n the three-
dimensional case, the subspace consists of all vectors perpendicular to the rotation a!is (the invariant direction, with eigenvalue ). Thus we can
e!tract from any #$# rotation matri! a rotation a!is and an angle, and these completely determine the rotation.
Sequential angles
The constraints on a $ rotation matri! imply that it must have the form
8age 9 of 0Rotation matri! - 5ikipedia, the free encyclopedia
-:-1;httpmatri!
-
8/11/2019 Transformation Rules in Rotation Matrices
8/18
xzxw xzyw xyxw xyzw
yxyw yxzw yzyw yzxw
zyzw zyxw zxzw zxyw
xzxb yzxb xyxb zyxb
yxyb zxyb yzyb xzyb
zyzb xyzb zxzb yxzb
with a2+b2= 1. Therefore we may set a= cos and b= sin , for some angle . To solve for it is not enough to look at aalone or balone; we
must consider both together to lace the angle in the correct !uadrant, using a two"argument arctangent function.
#ow consider the first column of a $%$ rotation matri&,
'lthough a2+b2will robably not e!ual 1, but some value r2( 1, we can use a slight variation of the revious comutation to find a so"called
)ivens rotation that transforms the column to
*eroing b. This acts on the subsace sanned by thexandya&es. e can then reeat the rocess for thexzsubsace to *ero c. 'cting on the full
matri&, these two rotations roduce the schematic form
hifting attention to the second column, a )ivens rotation of theyzsubsace can now *ero thezvalue. This brings the full matri& to the form
which is an identity matri&. Thus we have decomosed Qas
'n n%nrotation matri& will have -n1/+-n2/+
+2+1, or
entries below the diagonal to *ero. e can *ero them by e&tending the same idea of steing through the columns with a series of rotations in a
fi&ed se!uence of lanes. e conclude that the set of n%nrotation matrices, each of which has n2entries, can be arameteri*ed by n-n1/02
angles.
n three dimensions this restates in matri& form an observation made by uler, so mathematicians call the ordered
se!uence of three angles uler angles. 3owever, the situation is somewhat more comlicated than we have so far
indicated. 4esite the small dimension, we actually have considerable freedom in the se!uence of a&is airs we use; and
we also have some freedom in the choice of angles. Thus we find many different conventions emloyed when three"
dimensional rotations are arameteri*ed for hysics, or medicine, or chemistry, or other discilines. hen we include
the otion of world a&es or body a&es, 25 different se!uences are ossible. 'nd while some discilines call any
se!uence uler angles, others give different names -uler, 6ardano, Tait"7ryan, 8oll"itch"yaw/ to different se!uences.
9ne reason for the large number of otions is that, as noted reviously, rotations in three dimensions -and higher/ do not
commute. f we reverse a given se!uence of rotations, we get a different outcome. This also imlies that we cannot
comose two rotations by adding their corresonding angles. ThusEuler angles are not vectors, desite a similarity in aearance as a trile of
numbers.
Nested dimensions
' $%$ rotation matri& like
suggests a 2%2 rotation matri&,
:age of 18otation matri& " ikiedia, the free encycloedia
11"
-
8/11/2019 Transformation Rules in Rotation Matrices
9/18
is embedded in the upper left corner:
This is no illusion; not just one, but many, copies of n-dimensional rotations are found within (n+1)-dimensional rotations, as subgroups !ach
embedding lea"es one direction fi#ed, which in the case of $%$ matrices is the rotation a#is &or e#ample, we ha"e
fi#ing thexa#is, theya#is, and theza#is, respecti"ely The rotation a#is need not be a coordinate a#is; if u' (x,y,z) is a unit "ector in the desireddirection, then
where c' cos ,s' sin , is a rotation by angle lea"ing a#is ufi#ed
direction in (n+1)-dimensional space will be a unit magnitude "ector, which we may consider a point on a generali*ed sphere, Sn Thus it is
natural to describe the rotation group (n+1) as combining (n) and Sn suitable formalism is the fiber bundle,
where for e"ery direction in the base space, Sn, the fiber o"er it in the total space, (n+1), is a copy of the fiber space, (n), namely the
rotations that .eep that direction fi#ed
Thus we can build an n%nrotation matri# by starting with a /%/ matri#, aiming its fi#ed a#is on S/(the ordinary sphere in three-dimensional
space), aiming the resulting rotation on S$, and so on up through Sn01 point on Sncan be selected using nnumbers, so we again ha"e n(n01)/
numbers to describe any n%nrotation matri#
2n fact, we can "iew the se3uential angle decomposition, discussed pre"iously, as re"ersing this process The composition of n01 4i"ens rotations
brings the first column (and row) to (1,5,6,5), so that the remainder of the matri# is a rotation matri# of dimension one less, embedded so as to
lea"e (1,5,6,5) fi#ed
Skew parameters via Cayley's formula
7hen an n%nrotation matri#, Q, does not include 01 as an eigen"alue, so that none of the planar rotations of which it is composed are 1859
rotations, then Q+Iis an in"ertible matri# ost rotation matrices fit this description, and for them we can show that (Q0I)(Q+I)01is a s.ew-
symmetric matri#,A ThusAT' 0A; and since the diagonal is necessarily *ero, and since the upper triangle determines the lower one,Acontains n
(n01)/ independent numbers on"eniently,I0Ais in"ertible whene"erAis s.ew-symmetric; thus we can reco"er the original matri# using the
Cayley transorm,
which maps any s.ew-symmetric matri#Ato a rotation matri# 2n fact, aside from the noted e#ceptions, we can produce any rotation matri# in thisway lthough in practical applications we can hardly afford to ignore 1859 rotations, the ayley transform is still a potentially useful tool, gi"ing
a parameteri*ation of most rotation matrices without trigonometric functions
otation matri# - 7i.ipedia, the free encyclopedia
11-=-/51?http:enwi.ipediaorgwi.i>otation@matri#
-
8/11/2019 Transformation Rules in Rotation Matrices
10/18
In three dimensions, for example, we have (Cayley 1846)
If we condense the skew entries into a vector, (x,y,z), then we produce a !" rotation around thexaxis for (1,!,!), around theyaxis for (!,1,!), and
around thezaxis for (!,!,1)# $he 18!" rotations are %ust out of reach& for, in the limit asx'oes to infinity, (x,!,!) does approach a 18!" rotation
around thexaxis, and similarly for other directions#
Decomposition into shears
or the * case, a rotation matrix can +e decomposed into three shear matrices (aeth 186)-
$his is useful, for instance, in computer 'raphics, since shears can +e implemented with fewer multiplication instructions than rotatin' a +itmap
directly# .n modern computers, this may not matter, +ut it can +e relevant for very old or low/end microprocessors#
Group theory
Lie group
0e have esta+lished that nnrotation matrices form a 'roup, the special ortho'onal 'roup, 2.(n)# $his al'e+raic structure is coupled with a
topolo'ical structure, in that the operations of multiplication and takin' the inverse (which here is merely transposition) are continuous functions
of the matrix entries# $hus 2.(n) is a classic example of a topolo'ical 'roup# (In purely topolo'ical terms, it is a compact manifold#) urthermore,
the operations are not only continuous, +ut smooth, so 2.(n) is a differentia+le manifold and a 3ie 'roup#5
7ost properties of individual rotations of ndepend very little on the dimension n& nevertheless, in 3ie 'roup theory, we see systematic
differences +etween even dimensions and odd dimensions# urthermore, there are some isolated irre'ularities +elow n 5& for example, 2.(4) is,
anomalously, not a simple 3ie 'roup# Instead its (only) dou+le cover is isomorphic to the product S9 S9# :ither factor is clearly a normal
su+'roup, and hence so is its ima'e under the dou+le/coverin' homomorphism# $his shows 2.(4) is not simple#
Lie algebra
;ssociated with every 3ie 'roup is a 3ie al'e+ra, a linear space eere the +racket always vanishes, which tells us that, in two dimensions, rotations commute# ?ot so in any hi'her dimension#
or 99 rotation matrices, one has a three/dimensional vector space with the convenient +asis
$he 3ie +rackets of these 'enerators are as follows,
0e can conveniently identify any matrix in this 3ie al'e+ra with a vector in 9,
a'e 1! of 18@otation matrix / 0ikipedia, the free encyclopedia
11//!14http-AAen#wikipedia#or'AwikiA@otationBmatrix
-
8/11/2019 Transformation Rules in Rotation Matrices
11/18
Under this identification, the so(3) bracket has a memorable description; it is the vector cross product,
The matrix identified with a vector vis also memorable, because
Notice this implies that vis in the null space of the skew-smmetric matrix with which it is identified, because v!vis alwas the "ero vector#
Exponential map
$onnectin% the &ie al%ebra to the &ie %roup is the exponential map, which is defined usin% the standard matrix exponential series for eA
,'
*or an skew-smmetric matrixA, exp(A) is alwas a rotation matrix#
Note that this exponential map of skew-smmetric matrices to rotation matrices is +uite different from the $ale transform discussed earlier,
differin% to 3rd order,
n important practical example is the 3!3 case, where we have seen we can identif ever skew-smmetric matrix with a vector u, where
u (x,y,z)is a unit ma%nitude vector# .ecall that uis in the null space of the matrix associated with ; so that, if we use a basis with uas thezaxis, the final column and row will be "ero# Thus, we know in advance that the exponential matrix must leave ufixed# /t is mathematicall
impossible to suppl a strai%htforward formula for such a basis as a function of u(its existence would violate the hair ball theorem); but direct
exponentiation is possible, and ields
where c cos 01,s sin 0
1#
2e reco%ni"e this as our matrix for a rotation around axis ub the an%le cf# .odri%ues4 rotation formula#
/n an dimension, if we choose some non"eroAand consider all its scalar multiples, exponentiation ields rotation matrices alon% ageodesicofthe %roup manifold, formin% a one-parameter sub%roup of the &ie %roup#
5ore broadl, the exponential map provides a homeomorphism between a nei%hborhood of the ori%in in the &ie al%ebra and a nei%hborhood of the
identit in the &ie %roup# /n fact, we can produce an rotation matrix as the exponential of some skew-smmetric matrix, so for these %roups the
exponential map is asurjection#
BakerCampbellHausdorff formula
6uppose we are %ivenAandBin the &ie al%ebra# Their exponentials, exp(A) and exp(B), are rotation matrices, which we can multipl# 6ince the
exponential map is a sur7ection, we know that, for some Cin the &ie al%ebra, exp(A)exp(B) exp(C), and so we ma write
8a%e 99 of 9:.otation matrix - 2ikipedia, the free encclopedia
99--1>en#wikipedia#or%>wiki>.otation?matrix
-
8/11/2019 Transformation Rules in Rotation Matrices
12/18
When exp(A) and exp(B) commute, then C=A+B, mimicking the behavior of complex exponentiation. However, the general case is given b
the more elaborate !"H formula, a series expansion of nested brackets.#$%&or matrices, the bracket is the same operation as the commutator,
which monitors lack of commutativit in multiplication. 'his general expansion unfolds as follows,
epresentation of a rotation matrix as a seuential angle decomposition, as in *uler angles, ma tempt one to treat rotations as a vector space, but
the higher order terms in the !"H formula deprecate such an approach for large angles.
We again take special interest in the case, where #A,B%euals the cross product,AB. -fAandBare linearl independent, thenA,B, and
ABprovide a complete basis if not, thenAandBcommute. *videntl, in this dimension, the infinite expansion in the !"H formula for group
composition has a compact form, as C= A+B+ABfor suitable coefficients.#/%
(0lso see the straightforward 11 derivation for 23(1). &or the general nncase, use.#4%)
Spin group
'he 5ie group of nnrotation matrices, 26(n), is a compact and path7connected manifold, and thus locall compact and connected. However, it is
not simpl connected, so 5ie theor tells us it is a kind of 8shadow8 (a homomorphic image) of a universal covering group. 6ften the covering
group, which in this case is the spin group denoted b 2pin(n), is simpler and more natural to work with.#9:%
-n the case of planar rotations, 26(1) is topologicall a circle, S9. -ts universal covering group, 2pin(1), is isomorphic to the real line, R, under
addition. -n other words, whenever we use angles of arbitrar magnitude, which we often do, we are essentiall taking advantage of theconvenience of the 8mother space8. *ver 11 rotation matrix is produced b a countable infinit of angles, separated b integer multiples of 1;.
"orrespondingl, the fundamental group of 26(1) is isomorphic to the integers, Z.
-n the case of spatial rotations, 26() is topologicall euivalent to three7dimensional real pro is implied once the signs of the axis components are fixed.)
@an features of this case are the same for higher dimensions. 'he coverings are all two7to7one, with 26(n), nA 1, having fundamental group Z1.
'he natural setting for these groups is within a "lifford algebra. 0nd the action of the rotations is produced b a kind of 8sandwich8, denoted b
q"q.
Infinitesimal rotations
'he matrices in the 5ie algebra are not themselves rotations the skew7smmetric matrices are derivatives, proportional differences of rotations.
0n actual 8differential rotation8, or in#initesimal rotation matrixhas the form
where dis vanishingl small.
'hese matrices do not satisf all the same properties as ordinar finite rotation matrices under the usual treatment of infinitesimals .#99%'o
understand what this means, consider
&irst, test the orthogonalit condition, $%$=&. 'he product is
Bage 91 of 9/otation matrix 7 Wikipedia, the free encclopedia
997471:9httpCDDen.wikipedia.orgDwikiDotationEmatrix
-
8/11/2019 Transformation Rules in Rotation Matrices
13/18
differing from an identity matrix by second order infinitesimals, discarded here. So, to first order, an infinitesimal rotation matrix is an orthogonal
matrix.
Next, examine the square of the matrix,
Again discarding second order effects, note that the angle simply doubles. This hints at the most essential difference in behavior, which we can
exhibit with the assistance of a second infinitesimal rotation,
Compare the products dAxdAyto dAydAx,
Since d d'is second order, we discard it thus, to first order, multiplication of infinitesimal rotation matrices is commutati"e. !n fact,
again to first order. !n other words, the order in which infinitesimal rotations are applied is irrelevant.
This useful fact ma"es, for example, derivation of rigid body rotation relatively simple. #ut we must always be careful to distinguish $the firstorder treatment of% these infinitesimal rotation matrices from both finite rotation matrices and from derivatives of rotation matrices $namely s"ew&
symmetric matrices%. Contrast the behavior of finite rotation matrices in the #C' formula above with that of infinitesimal rotation matrices, where
all the commutator terms will be second order infinitesimals so we dohave a bona fide vector space. $Technically, this dismissal of any second
order terms amounts to (roup contraction.%
Conversions
)e have seen the existence of several decompositions that apply in any dimension, namely independent planes, sequential angles, and nested
dimensions. !n all these cases we can either decompose a matrix or construct one. )e have also given special attention to *+* rotation matrices,
and these warrant further attention, in both directions $Stuelpnagel -/%.
Quaternion
(iven the unit quaternion q0 $!,x,y,z%, the equivalent left&handed $1ost&2ultiplied% *+* rotation matrix is
Now every quaternion component appears multiplied by two in a term of degree two, and if all such terms are 3ero what4s left is an identity matrix.
This leads to an efficient, robust conversion from any quaternion 5 whether unit or non&unit 5 to a *+* rotation matrix.
n = w * w + x * x + y * y + z * z
s = if n == 0 then 0 else 2 / n
wx = s * w * x, wy = s * w * y, wz = s * w * z
xx = s * x * x, xy = s * x * y, xz = s * x * z
yy = s * y * y, yz = s * y * z, zz = s * z * z
[ 1 - (yy + zz) xy - wz xz + wy ]
[ xy + wz 1 - (xx + zz) yz - wx ]
[ xz - wy yz + wx 1 - (xx + yy) ]
1age * of 67otation matrix & )i"ipedia, the free encyclopedia
&-&89/http::en.wi"ipedia.org:wi"i:7otation;matrix
-
8/11/2019 Transformation Rules in Rotation Matrices
14/18
Consider a 22 example. Including constraints, we seek to minimize
Freed from the demand for a unit quaternion, we find that nonzero quaternions act as homogeneous coordinates for 33 rotation matrices. he
Ca!le! transform, discussed earlier, is o"tained "! scaling the quaternion so that its !component is #. For a #$%& rotation around an! axis, !will
"e zero, which explains the Ca!le! limitation.
he sum of the entries along the main diagonal 'the trace(, plus one, equals )*)'x2+y2+z2(, which is )!2. hus we can write the trace itself as
2!2+2!2*# and from the pre-ious -ersion of the matrix we see that the diagonal entries themsel-es ha-e the same form 2x2+2!2*#, 2y2+2!2*#,
and 2z2+2!2*#. /o we can easil! compare the magnitudes of all four quaternion components using the matrix diagonal. 0e can, in fact, o(tainall
four magnitudes using sums and square roots, and choose consistent signs using the skew1s!mmetric part of the off1diagonal entries.
t = Qxx+Qyy+Qzz(trace of Q)
r = sqrt(1+t)
w = 0.5*r
x = copysign(0.5*sqrt(1+Qxx-Qyy-Qzz), Qzy-Qyz)
y = copysign(0.5*sqrt(1-Qxx+Qyy-Qzz), Qxz-Qzx)
z = copysign(0.5*sqrt(1-Qxx-Qyy+Qzz), Qyx-Qxy)
where cop!sign'x,y( isxwith the sign ofy
lternati-el!, use a single square root and di-ision
t = Qxx+Qyy+Qzzr = sqrt(1+t)
s = 0.5/r
w = 0.5*r
x = (Qzy-Qyz)*s
y = (Qxz-Qzx)*s
z = (Qyx-Qxy)*s
his is numericall! sta"le so long as the trace, t, is not negati-e otherwise, we risk di-iding "! 'nearl!( zero. In that case, suppose Qxxis the
largest diagonal entr!, soxwill ha-e the largest magnitude 'the other cases are similar( then the following is safe.
t = Qxx+Qyy+Qzzr = sqrt(1+Qxx-Qyy-Qzz)
s = 0.5/r
w = (Qzy-Qyz)*s
x = 0.5*r
y = (Qxy+Qyx)*s
z = (Qzx+Qxz)*s
If the matrix contains significant error, such as accumulated numerical error, we ma! construct a s!mmetric )) matrix,
and find the eigen-ector, 'x,y,z,!(, of its largest magnitude eigen-alue. 'If $is trul! a rotation matrix, that -alue will "e #.( he quaternion so
o"tained will correspond to the rotation matrix closest to the gi-en matrix'ar1Itzhack 2%%%(.
Polar decomposition
If the nnmatrix)is non1singular, its columns are linearl! independent -ectors thus the 4ram5/chmidt process can ad6ust them to "e an
orthonormal "asis. /tated in terms of numerical linear alge"ra, we con-ert)to an orthogonal matrix, $, using 78 decomposition. 9owe-er, we
often prefer a $:closest: to), which this method does not accomplish. For that, the tool we want is the polar decomposition 'Fan ; 9offman
#
-
8/11/2019 Transformation Rules in Rotation Matrices
15/18
Taking the derivative with respect to $xx, $xy, $yx, $yyin turn, we assemble a matrix.
where $is orthogonal and Sis symmetric. To ensure a minimum, the *
matrix (and hence S) must be positive definite. Linear algebra calls $S
the polar decomposition of), with Sthe positive square root of S!
)T).
"hen)is non#singular, the $and Sfactors of the polar decomposition
are uniquely determined. $owever, the determinant of Sis positive
because Sis positive definite, so $inherits the sign of the determinant of). That is, $is only guaranteed to be orthogonal, not a rotation matrix.
This is unavoidable% an)with negative determinant has no uniquely defined closest rotation matrix.
Axis and angle
To efficiently construct a rotation matrix & from an angle ' and a unit axis u, we can take advantage of symmetry and skew#symmetry within the
entries. fx,y, andzare the components of the unit vector representing the axis, and
then
etermining an axis and angle, like determining a quaternion, is only possible up to sign% that is, (u,') and (*u,*') correspond to the same rotation
matrix, +ust like qand *q. s well, axis#angle extraction presents additional difficulties. The angle can be restricted to be from - to /0-, but
angles are formally ambiguous by multiples of 12-. "hen the angle is 3ero, the axis is undefined. "hen the angle is /0-, the matrix becomes
symmetric, which has implications in extracting the axis. 4ear multiples of /0-, care is needed to avoid numerical problems5 in extracting the
angle, a two#argument arctangent with atan2(sin ,cos )equal to ' avoids the insensitivity of arccosine% and in computing the axis magnitude
in order to force unit magnitude, a brute#force approach can lose accuracy through underflow (6oler 7 6orrison /801).
partial approach is as follows5
Thex,y, andzcomponents of the axis would then be divided by r. fully robust approach will use different code when t, the trace of the matrix
$, is negative, as with quaternion extraction. "hen ris 3ero because the angle is 3ero, an axis must be provided from some source other than the
matrix.
Euler angles
9omplexity of conversion escalates with :uler angles (used here in the broad sense). The first difficulty is to establish which of the twenty#four
variations of 9artesian axis order we will use. ;uppose the three angles are '/, ', '1% physics and chemistry may interpret these as
while aircraft dynamics may use
by choosing static or rotating axes.
This is enough to construct a matrix from angles, but triples differing in many ways can give the same rotation matrix. ?or example, suppose we
use the zyzconvention above% then we have the following equivalent pairs5
(8-, >@, */-@) A (*B-, *1/@, @@) multiples o# ,-.
Cage /@ of /0Dotation matrix # "ikipedia, the free encyclopedia
//#8#-/>http5EEen.wikipedia.orgEwikiEDotationFmatrix
-
8/11/2019 Transformation Rules in Rotation Matrices
16/18
-
8/11/2019 Transformation Rules in Rotation Matrices
17/18
8. ^(Eng 2001)
9. ^Curtright, T L; Fairlie, D B; Zach!, C " (201#). $% c&'act r&ula r rtatin! a! !'in &atri 'l*n&ial!$. S!G"A 10+ 08#.
i+10.-8#2/%.201#.08# (htt'+.i.rg10.-8#232F/%.201#.08#).
10. ^Ba4er 200-, Ch. 5; Fultn 6 7arri! 1991, ''. 299-15
11. ^(l!tein, le 6 /a4 2002, :#.8)
References
%r, , i+10.251#2.#A5# (htt'+.i.rg10.251#32F2.#A5#), //? 0>-1@5090
(htt'!+===.=rlcat.rgi!!n0>-1@5090)
Brc4, G4e; B=ie, Claett (1), $%n iteratie algrith& r c&'uting the He!t e!ti&ate an rthgnal &atri$, S!A" &ournal
on )umerical Analysis 8(2)+ -58-A#, i+10.11->0>080-A (htt'+.i.rg10.11->32F0>080-A), //? 00-A@1#29
(htt'!+===.=rlcat.rgi!!n00-A@1#29)
Ca*le*, %rthur (18#A), $/ur uelue! 'r'riItI! e! Iter&inant! gauche!$,&ournal f*r die reine und angewandte "athemati+32+ 119
12-, i+10.1515crll.18#A.-2.119 (htt'+.i.rg10.151532Fcrll.18#A.-2.119), //? 00>5@#102 (htt'!+===.=rlcat.rgi!!n00>5@
#102); re'rinte a! article 52 in Ca*le*, %rthur (1889), The collected mathematical papers of Arthur Cayley
(htt'+===.hti.u&ich.eucgittet'ageie=er@iJcKu&hi!t&ath;ccKu&hi!t&ath;rgnKull3
20tet;inK%B/-15-.0001.001;inK%B/-15-.0001.001;ie=Ki&age;!eK00000-#9), (18#1185-), Ca&Hrige nier!it* re!!,
''. --2--A
Diacni!, er!i; /hah!hahani, ehra (198>), $The !uHgru' algrith& r generating unir& ran& ariaHle!$,,robability in the
ngineering and !nformational Sciences 1+ 15-2, i+10.101>/02A99A#800000255 (htt'+.i.rg10.101>32F/02A99A#800000255),
//? 02A9@9A#8 (htt'!+===.=rlcat.rgi!!n02A9@9A#8)
Eng, "enth (9515229),
//? 000A@-8-5 (htt'!+===.=rlcat.rgi!!n000A@-8-5)
Fan, "*; 7&an, %lan 32F20-2AA2), //? 0002@99-9
(htt'!+===.=rlcat.rgi!!n0002@99-9), 8@
0@-8>@9>#95@8, O 115-2#9 (htt'!+===.a&!.rg&ath!cinet@getite&J&rK115-2#9)
l!tein, 7erHert; le, Charle! .; /a4, @8#9-3289-3299000-@
O), //? 009>@8#9- (htt'!+===.=rlcat.rgi!!n009>@8#9-)
7igha&, ?ichla! @259)
ile!, Oger E. (Dece&Her 19A5), $Mn ran& rtatin! in-$,.iometri+a(Bi&etri4a, Nl. 52, ?. -#) 52(-#)+ A-AA-9,
i+10.2-0>2--->1A (htt'+.i.rg10.2-0>32F2--->1A), //? 000A@-### (htt'!+===.=rlcat.rgi!!n000A@-###),
1A (htt'!+ ===.!tr.rg!taHle2--->1A)
ler, Clee; rri!n, Dnal (198-), $Oe'lacing !uare rt! H* '*thagrean
!u&!$ (htt'+&in.=at!n.iH&.c&tchrurnaline.n!0H9Hc#Ae0AcHac18525A5eA00Ae1a000#-0-ee1c101-c8525AHa00A>5aAJ
M'enDcu&ent),!." &ournal of esearch and (e2elopment27(A)+ 5>>581, i+10.11#>r.2>A.05>> (htt'+.i.rg10.11#>3
2Fr.2>A.05>>), //? 0018@8A#A (htt'!+===.=rlcat.rgi!!n0018@8A#A)
age 1> 18Otatin &atri @ Pi4i'eia, the ree enc*cl'eia
11@9@201#htt'+en.=i4i'eia.rg=i4iOtatinR&atri
-
8/11/2019 Transformation Rules in Rotation Matrices
18/18
Murnaghan, Francis D. (1950), "The element of volume of the rotation group" (http!!.pnas.org!content!vol#$!issue11!),,roceedings
of the )ational Academy of Sciences36 (11) $%0&$%', oi10.10%#!pnas.#$.11.$%0 (http!!.oi.org!10.10%#*'Fpnas.#$.11.$%0),
+- 00'%/' (https!!.orlcat.org!issn!00'%/')
Murnaghan, Francis D. (19$'), The 3nitary and otation Groups, ectures on applie mathematics, 2ashington partan 3oo4s
a6le6, 7rthur (1//9), The collected mathematical papers of Arthur Cayley (http!!.hti.umich.eu!cgi!t!tet!pagevieeri8
cumhistmath:ccumhistmath:rgnfull*'0tet:ino73#15#.0001.001:ino73#15#.0001.001:vieimage:se;00000#9), + (1/1
&1/5#), amress, pp. ##'#$
>aeth, 7lan 2. (19/$), "7 Fast 7lgorithm for ?eneral @aster @otation" (http!!.cipprs.org!papers!A+!A+19/$!pp0%%0/1>aeth
19/$.pf),,roceedings' Graphics !nterface 456 %%&/1
>i;ue, Michael B. (1990), "@otation Tools" (http!!.graphicsgems.org!), in 7nre . ?lassner, Graphics Gems, an Diego 7caemic
>ress >rofessional, pp. $5&$9, +3- 9%/01''/$1$$$
>ress, 2illiam C.: Teu4ols46, aul 7.: Aetterling, 2illiam T.: Flanner6, 3rian >. ('00%), "ection '1.5.'. >ic4ing a @anom @otation
Matri" (http!!apps.nraul Cec4ress >rofessional, pp. '''&''9, +3- 9%/01'##$155
tuelpnagel, ohn (Ictoage 1/ of 1/@otation matri 2i4ipeia, the free enc6clopeia