Euler angles
Euler angles are a three-parameter representation of rotations , and are derived from the definitions of and above. They are one of the oldest rotation representations, are easy to interpret, and are also frequently used in aeronautics and robotics. The basic idea is to select three different axes and represent the rotation as a composite of three axis-aligned rotations. The order in which axes are chosen is a matter of convention.
1. Conventions
For example, the roll-pitch-yaw convention often used in aerospace assumes that a vehicle's roll angle is about its X axis, pitch is about its Y axis, and yaw is about its Z axis , with the composite rotation given by:
Notice that the order of rotation axes is Z , Y , X , and this is also known as ZYX convention. (Note that in order of application, this applies roll (X) first, then pitch (Y), then yaw (Z).)
Roll-pitch-yaw convention consists of a roll about the vehicle's forward direction, a pitch about its leftward direction,
and a yaw around its upward direction.
There are a multitude of other conventions possible, each of the form (*)
where A , B ,
and C are one of X , Y , or Z . To be a valid convention, the span of possible results from the convention must span the range of possible rotation matrices, and this means that no two subsequent axes may be the same, e.g., XXY is not
permissible, since two combined rotations about one axis are equivalent to a single rotation about that axis. However, A and C may indeed be the same, for example, in ZYZ convention:
Here the intervening
Y rotation modifies the axis by which one of the RZ terms rotates, and can in fact span all rotation matrices.
2. Conversion between matrices
Conversion from Euler angles to rotation matrices is a straightforward computation of (*). The converse is more challenging and requires calculating the inverse of the forward conversion using some trigonometry.
First, for the given convention we would begin by equating the matrix terms to the sine and cosine terms of the computed rotation matrix, e.g., for roll-pitch-yaw convention:
where we use the shorthand
The simplest term is in the lower left corner, so we find one of the two solutions to , namely or . We also have two possible solutions . If is nonzero, then we can divide and by to obtain and , respectively, by which we can obtain via the
argument of . Similarly, we may derive by dividing and by . Finally one of the two possible solutions to can be obtained by verifying the solution to the upper right entries of the matrix.
The other case to consider is when is zero, which indicates that the pitch is . If this is the case, then only and the 2×2 entries in the upper right are nonzero. This corresponds to a singular case in which
infinite solutions for and exist. All of these solutions have equal to the argument of .
3. Singularities, aka gimbal lock
The minimal range of Euler angles to cover the span of rotations is the set . However, this set is not topologically equivalent to SO(3). There are certain cases in which a single rotation has an infinite number of solutions. For example, in ABA convention,
any pure rotation about the A axis can be represented by Euler angles with but infinitely many values of and with constant sum. In roll-pitch-yaw convention, pitches of align the roll and yaw axes, and hence when a vehicle is pointed directly upward there are an infinite number of solutions for and .
Cases like this are known as singular. By analogy with the gimbal mechanism which is a physical device with three rotating axes, gimbal lock. Gimbals are devices often used in gyroscopes to measure 3D orientation by means of a
rapidly spinning mass which maintains its absolute orientation as its cradle rotates. Gimbal lock manifests itself when two axes of the mechanism become aligned, at which point the gimbal readings become useless because most rotations
of the cradle fail to de-align the axes properly
In calculations, singularities cause problems for conversions, calculating derivatives, and interpolation.
4. Inversion
The inverse of an Euler angle with convention ABC is another set of Euler angles with convention CBA . This is quite convenient when an ABA convention is used, because the reverse convention is the same as the forward. However, when , finding the inverse Euler angles in the same convention is much less convenient, because it requires conversion to matrix form and then back to Euler angle form.