Professional Documents
Culture Documents
Jump to: navigation, search In linear algebra, a rotation matrix is a matrix that is used to perform a rotation in Euclidean space. For example the matrix
rotates points in the xy-Cartesian plane counterclockwise through an angle about the origin of the Cartesian coordinate system. To perform the rotation using a rotation matrix R, the position of each point must be represented by a column vector v, containing the coordinates of the point. A rotated vector is obtained by using the matrix multiplication Rv. Since matrix multiplication always fixes the zero vector, rotation matrices can only be used to describe rotations that fix the origin. Rotation matrices provide a simple algebraic description of such rotations, and are used extensively for computations in geometry, physics, and computer graphics. These rotations can be in dimension 2, where they are determined by the angle of rotation, or in dimension 3, where in addition an axis of rotation is involved; the angle and axis are implicitly represented by the entries of the rotation matrix. The notion of rotation is not commonly used in dimensions higher than 3; there is a notion of a rotational displacement, which can be represented by a matrix, but no associated single axis or angle. Rotation matrices are square matrices, with real entries. More specifically they can be characterized as orthogonal matrices with determinant 1: . The set of all such matrices of size n forms a group, known as the special orthogonal group SO(n).
Contents
1 Rotations in two dimensions o 1.1 Non-standard orientation of the coordinate system o 1.2 Common rotations 2 Rotations in three dimensions o 2.1 Basic rotations o 2.2 General rotations o 2.3 Conversion from and to axis-angle 2.3.1 Determining the axis 2.3.2 Determining the angle 2.3.3 Rotation matrix from axis and angle
3 Properties of a rotation matrix 4 Examples 5 Geometry 6 Multiplication 7 Ambiguities 8 Decompositions o 8.1 Independent planes o 8.2 Sequential angles o 8.3 Nested dimensions o 8.4 Skew parameters via Cayley's formula 9 Lie theory o 9.1 Lie group o 9.2 Lie algebra o 9.3 Exponential map o 9.4 BakerCampbellHausdorff formula o 9.5 Spin group 10 Infinitesimal rotations 11 Conversions o 11.1 Quaternion o 11.2 Polar decomposition o 11.3 Axis and angle o 11.4 Euler angles 12 Uniform random rotation matrices 13 See also 14 Notes 15 References 16 External links
A counterclockwise rotation of a vector through angle . The vector is initially aligned with the x-axis. In two dimensions every rotation matrix has the following form:
. So the coordinates (x',y') of the point (x,y) after rotation are: , . The direction of vector rotation is counterclockwise if is positive (e.g. 90), and clockwise if is negative (e.g. -90).
A rotation through angle with non-standard axes. If a standard right-handed Cartesian coordinate system is used, with the x axis to the right and the y axis up, the rotation R() is counterclockwise. If a left-handed Cartesian coordinate system is used, with x directed to the right but y directed down, R() is clockwise. Such non-standard orientations are rarely used in mathematics but are common in 2D computer graphics, which often have the origin in the top left corner and the y-axis down the screen or page.[1]
See below for other alternative conventions which may change the sense of the rotation produced by a rotation matrix.
Each of these basic vector rotations typically appears counter-clockwise when the axis about
which they occur points toward the observer, and the coordinate system is right-handed. Rz, for instance, would rotate toward the y-axis a vector aligned with the x-axis. This is similar to the rotation produced by the above mentioned 2-D rotation matrix. See below for alternative conventions which may apparently or actually invert the sense of the rotation produced by these matrices.
represents a rotation whose yaw, pitch, and roll are , , and , respectively. Similarly, the product
represents a rotation whose Euler angles are , , and (using the y-x-z convention for Euler angles). The orthogonal matrix (post-multiplying a column vector) corresponding to a clockwise/left-handed rotation with Euler angles ,,, with x-y-z convention, is given by:
There are several methods to compute an axis and an angle from a rotation matrix (see also axis-angle). Here, we only describe the method based on the computation of the eigenvectors and eigenvalues of the rotation matrix. It is also possible to use the trace of the rotation matrix. [edit] Determining the axis
A rotation R around axis u can be decomposed using 3 endomorphisms P, (I - P), and Q (click to enlarge). Given a rotation matrix R, a vector u parallel to the rotation axis must satisfy
since the rotation of around the rotation axis must result in . The equation above may be solved for which is unique up to a scalar factor. Further, the equation may be rewritten
another way, is an eigenvector of R corresponding to the eigenvalue = 1 (every rotation matrix must have this eigenvalue). [edit] Determining the angle To find the angle of a rotation, once the axis of the rotation is known, select a vector perpendicular to the axis. Then the angle of the rotation is the angle between and . A much easier method, however, is to calculate the trace (i.e. the sum of the diagonal elements of the rotation matrix) which is 1 + 2cos . [edit] Rotation matrix from axis and angle For some applications, it is helpful to be able to make a rotation with a given axis. Given a unit vector u = (ux, uy, uz), where ux2 + uy2 + uz2 = 1, the matrix for a rotation by an angle of about an axis in the direction of u is
where is the cross product matrix of u, is the tensor product and I is the Identity matrix. This is a matrix form of Rodrigues' rotation formula, with
If the 3D space is right-handed, this rotation will be counterclockwise for an observer placed so that the axis u goes in his or her direction (Right-hand rule).
(i.e.,
is an orthogonal matrix) is 1)
is
Some of these properties can be generalised to any number of dimensions. In other words, they hold for any rotation matrix . For instance, in two dimensions the properties hold with the following exceptions:
a is not a given axis, but a point (rotation center) which must coincide with the origin of the coordinate system in which the rotation is represented. 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.
corresponds to a 9
The 33 permutation
point, a reflection exchange s left- and righthanded ordering, and a glide reflection does both. A rotation that does not leave "handedn ess" unchange d is an improper rotation or a rotoinver sion. If we take the fixed point as the origin of a Cartesian coordinat e system, then every point can be given coordinat es as a displace ment from the origin. Thus we may work with the vector
space of displace ments instead of the points themselv es. Now suppose (p1,,pn) are the coordinat es of the vector p from the origin, O, to point P. Choose an orthonor mal basis for our coordinat es; then the squared distance to P, by Pythagor as, is
whic h we can comp ute using the matri x multi plicat ion
A g e o m et ri c r ot at io n tr a n sf o r m s li n e s to li n e s, a n d p re s er v e s ra ti o s
o f di st a n c e s b et w e e n p oi nt s. F r o m th e s e p r o p er ti e s w e c a n s h o w th at a r ot at
io n is a li n e ar tr a n sf o r m at io n o f th e v e ct o rs , a n d th u s c a n b e w ri tt e n in m at ri x f
o r m , Q p. T h e fa ct th at a r ot at io n p re s er v e s, n ot ju st ra ti o s, b ut di st a n c e s th e m s el v e
s, w e c a n st at e a s
o r
B e c a u s e t h i s e q u a t i o n h o l d s f
o r a l l v e c t o r s , p , w e c o n c l u d e t h a t e v e r y r o t a t i o n
m a t r i x , Q , s a t i s f i e s t h e o r t h o g o n a l i t y c o n d i t i o n ,
R o t a t i o n s p r e s e r v e h a n d e d n e s s b e c a u s e t h e y c a n n o
t c h a n g e t h e o r d e r i n g o f t h e a x e s , w h i c h i m p l i e s t
h e s p e c i a l m a t r i x c o n d i t i o n ,
E q u a l l y
i m p o r t a n t ,
w e
c a n
s h o w
t h a t
a n y
m a t r i x
s a t i s f y i n g
t h e s e
t w o
o n d i t i o n s
a c t s
a s
r o t a t i o n .
[ e d i t ]
M u l t i p
l i c a t i o n
T h e
i n v e r s e
o f
r o t a t i o n
m a t r i x i s i
t s
t r a n s p o s e ,
w h i c h i s
a l s o
r o t a t i o n
m a t r i x :
The change in a vector's coordinates can be due to a turn of the coordinate system (alias) or a turn of the vector (alibi). Any rotation can be legitimately described both ways, as vectors and coordinate systems actually rotate with respect to each other. Throughout this article, we chose the alibi approach to describe rotations.
The vector can be pre-multiplied by a rotation matrix (Rv, where v is a column vector), or post-multiplied by it (vR, where v is a row vector). Throughout this article, we described rotations produced by means of a pre-multiplication.
The matrix and the vector can be represented with respect to a right-handed or lefthanded coordinate system. Throughout the article, we assumed a right-handed orientation, unless otherwise specified.
The vector space has a dual space of linear forms, and the matrix can act on either vectors or forms.
(90, 45, 105) (270, 315, 255) (72, 0, 0) (40, 0, 32) (45, 60, 30) (135, 60, 150)
es in axis-angle form, the angle should not be uniformly distributed; the probability that (the magnitude of)
ow to use the Cayley transform to generate and test matrices according to this criterion.
rmly distributed on the n-sphere, Sn, embed the nn matrix in the next larger size with last column (0,,0,1),
lanar rotation.