Return to voicebox home page
In 3-dimensions, the x, y and z axes form a right-handed triple. A positive rotation of π/2 radians around one of these axes will rotate y->z, z->x or x->y respectively, i.e. it corresponds to a clockwise rotation when looking along the corresponding axis from the origin.
Applying a sequence of rotations to an object can have one of four interpretations: (a) they can be viewed as rotating the object or as rotating the axes (or, equivalently, the camera) and (b) the rotation axes can remain fixed in space ("extrinsic") or can change with each rotation ("intrinsic"). The choice of interpretation affects the order and sign of the rotations. The four examples listed below all result in the same rotation matrix: in each case, multiplying by the rotation matrix converts a column vector containing the coordinates of an object-point to its new value.
To perform an arbitrary rotation, it is necessary to rotate about three axes in sequence. Consecutive rotations must be around different axes but the first and third axes may either be the same ("Proper Euler angles") or different ("Tait-Bryan angles"). In the aerospace field, the conventional axes orientations relative to an aeroplane are: x=forward, y=right, z=down. Using the intrinsic+object formulation and an axis order zyx, the three rotations are called yaw, pitch and roll.
There is a redundancy in the Euler angle representation:
Rotations can be represented in any of the eight forms listed below; each has a two-letter mnemonic given in the first column. The conversion routine from form xx to form yy is called v_rotxx2yy. The second column lists the parameters required: A,a,a,a denote matrix, vector, scalar and text arguments and the subscripts indicate their dimension. The ro and pl forms can be used in a n-dimensional space; the other forms are restricted to 3-dimensions. To visualize a rotation, call any of the routines without any output argument; a rotated cube will be plotted in 3D.
|Code||Params||Convert from||Convert to||Description|
|ro||Rn#n||eu, pl, qr||eu, pl, qr||Rotation Matrix: This is an n by n rotation matrix. Multiplying the coordinates of an object by R gives the coordinates of the rotated object. [rotation matrix properties]|
|eu||m,t3||qr, ro||qr, ro||Euler Angles: t contains a sequence of "euler angles" while m contains the sequence of axes around which the rotations should be performed (e.g. 'xzy' means rotate around x first). The axes are fixed in space and do not rotate with the object.|
|ax||a3,t||qr||qr||Axis of Rotation: the axis of rotation is a, while t gives the rotation angle in radians.|
|pl||un,vn,t||ro||ro||Plane of Rotation: The plane of rotation is that containing u and v while t gives the rotation angle in radians. If t is omitted, the rotation moves direction u to direction v.|
|qr||q4||ax, eu, mr, qc, ro||ax, eu, mr, qc, ro||Real Quaternion Vector: q = [c; s*a] where c=cos(t/2), s=sin(t/2) and a is the axis of rotation. The values q and -q represent the same rotation. [quaternion properties]|
|mr||Q4#4||qr||qr||Real Quaternion Matrix: A 4 by 4 real matrix whose first column is the real quaternion vector defined above. Multiplication of quaternion matrices is homomorphic to multiplication of the corresponding rotation matrices.|
|qc||q2||mc, qr||mc, qr||Complex Quaternion Vector: A 2 element vector of the form a+jb where [a; b] is the real quaternion vector defined above.|
|mc||Q2#2||qc||qc||Complex Quaternion Matrix: A 2 by 2 complex matrix whose first column is the complex quaternion vector defined above. Multiplication of quaternion matrices is homomorphic to multiplication of the corresponding rotation matrices.|