According to Euler's rotation theorem the general displacement of a rigid body (or coordinate frame) with one point fixed is described by a rotation about some axis. Furthermore, such a rotation may be uniquely described by a minimum of three parameters. However, for various reasons, there are several ways to represent such a rotation. Many of these definitions use more than the necessary minimum of three parameters, although any such representation still has only three degrees of freedom.
An example where rotation representation is used is in computer vision, where an automated observer needs to track a target. Let's consider a rigid body, with an orthogonal right-handed triad , and of unit vectors fixed to its body (the object coordinate system). The basic problem is to specify the orientation of this triad, and hence the rigid body, in terms of the reference coordinate frame (in our case the camera coordinate system).
It is clear that specifying the coordinates (scalar components) of a basis for our new (rotated) set of coordinate axes in terms of the original (non-rotated) coordinate axes, will completely describe the rotation. The three unit vectors , and which form the basis for our new system each consists of 3 coordinates, yielding a total of 9 parameters. These parameters can be written as the elements of a matrix , called the rotation matrix or direction cosine matrix (DCM).
Each of the elements is the cosine of the angle between a rotated unit basis vector and one of the reference axes, and this is the reason why is often called the direction cosine matrix. The elements of the DCM are not all independent - as Euler's rotation theorem dictates, the DCM has only three degrees of freedom. The DCM has the following properties:
The angle which appears in the eigenvalue expression corresponds to the angle of the Euler axis and angle representation. The eigenvector corresponding with the eigenvalue of 1 is the accompanying Euler axis, since the axis is the only (nonzero) vector which remains unchanged by left-multiplying (rotating) it with the rotation matrix.
Two successive rotations represented by matrices and are easily combined as follows: (Note the order, since the vector being rotated is multiplied from the right). The ease by which vectors can be rotated using a DCM, as well as the ease of combining successive rotations, make the DCM a very useful and popular way to represent rotations, even though it is less concise than other representations.
From Euler's rotation theorem we know that any rotation can be expressed as a single rotation about some axis. The axis is the unit vector (unique except for sign) which remains unchanged by the rotation. The magnitude of the angle is also unique, with its sign being determined by the sign of the rotation axis.
The axis can be represented as a three-dimensional unit vector , and the angle by a scalar .
Since the axis is normalized, it has only two degrees of freedom. The angle adds the third degree of freedom to this rotation representation.
A similar but more concise way to express rotation is by using a rotation vector, a non-normalized three-dimensional vector the direction of which specifies the axis, and the length of which is :
If the rotation angle is zero, the axis is not uniquely defined. Combining two successive rotations, each represented by an Euler axis and angle, is not straightforward. It is usual to convert to direction cosine matrix (DCM) or quaternion notation, calculate the product, and then convert back to Euler axis and angle.
Unfortunately, the definition of Euler angles is not unique and in the literature many different conventions are used. These conventions depend on the axes about which the rotations are carried out, and their sequence (since rotations are not commutative).
The convention being used is usually indicated by specifying the axes about which the consecutive rotations (before being composed) take place, referring to them by index (1,2,3) or letter (X,Y,Z). The engineering and robotics communities typically use 3-1-3 Euler angles. Notice that after composing the independent rotations, they do not rotate about the axis anymore. The most external matrix rotates the other two, leaving the second rotation matrix over the line of nodes, and the third one in a frame comoving with the body. There are 3x3x3 = 27 possible definitions for Euler Angle rotations, but not all of them represent real decompositions.
The Euler angles are never expressed in terms of the external frame, or in terms of the co-moving rotated body frame, but in a mixture. Other angle conventions (e.g., Tait-Bryan angles, Fick angles, Helmholtz angles, roll-pitch-yaw, dip-slip-rake, azimuth-elevation-skew) are used to avoid this problem.
Quaternions (Euler symmetric parameters) have proven very useful in representing rotations due to several advantages above the other representations mentioned in this article.
A quaternion representation of rotation is written as a normalized four dimensional vector . In terms of the Euler axis and angle this vector's elements are expressed as follow:
The above definition follows the convention as used in (Wertz 1980) and (Markley 2003). An alternative definition used in some publications defines the "scalar" term as the first quaternion element, with the other elements shifted down one position. (Coutsias 1999), (Schmidt 2001)
Inspection shows that the quaternion parametrization obeys the following constraint:
The last term (in our definition) is often called the scalar term, which has its origin in quaternions when understood as the mathematical extension of the complex numbers, written as
and where are the hypercomplex numbers satisfying
Quaternion multiplication is performed in the same manner as multiplication of complex numbers, except that the order of elements must be taken into account, since multiplication is not commutative. In matrix notation we can write quaternion multiplication as
Combining two consecutive quaternion rotations is therefore just as simple as using DCMs. Remember that two successive DCM rotations, followed by , are combined as follows:
We can represent this quaternion parameters in a similarly concise way. Please note the inverse ordering of quaternion multiplication when compared to DCM multiplication.
Quaternions are a very popular parametrization due to the following properties:
Like DCM's, quaternions must sometimes be re-normalized due to rounding errors, to make sure that they correspond to valid rotations. The computational cost of re-normalizing a quaternion, however, is much less than for normalizing a DCM.
The Gibbs vector is undefined for rotations, which is undesirable for global attitude representation.
Modified Rodriguez parameters (MRPs) can be expressed in terms of Euler axis and angle by:
The modified Rodrigues parametrization shares many characteristics with the rotation vector parametrization, including the occurrence of discontinuous jumps in the parameter space when incrementing the rotation.
Using the x-convention, the 3-1-3 Euler angles , and (around the , and again the -axis) can be obtained as follows:
Note that is equivalent to where we also take into account the quadrant in which the point is in.
Alternatively, the following method can be used:
Eigen-decomposition of the DCM yields the eigenvalues , and . The Euler axis is the eigenvector corresponding to the eigenvalue of , and the can be computed from the remaining eigenvalues.
The Euler axis can be also found using Singular Value Decomposition since it is the normalized vector spanning the null-space of the matrix .
One way of computing the quaternion from the rotation matrix is as follows:
There are three other mathematically equivalent ways to compute . Numerical inaccuracy can be reduced by avoiding situations in which the denominator (in this case ) is close to zero. For small angles . One of the other three methods looks as follows:
The DCM of the complete rotation, , is the matrix product of the three matrices for the individual rotations. The first rotation's matrix is on the right and the last on the left, since we left-multiply the orientation vector by the rotation matrix.
If we use the general convention instead of the x-convention, the order of multiplication is reversed (this can be proven by writing out the equations).
The axes of the rotation depend on the specific convention being used. For rotations about the , and axes with angles , and , the individual matrices are as follows:
We can compute the quaternion from the Euler angles as follows:
Warning: The above formulae are wrong. Consider Euler angles rotation . The above gives instead of
with the identity matrix, and
with the identity matrix, and
Given the quaternion , the x-convention 3-1-3 Euler angles can be computed by
Warning: The above formulae are wrong. Consider a rotation about the z-axis, i.e. . Then we get .