degrees of freedom, and thus at most three quantities are required to specify its orientation. This can be easily seen by examining the constraints that govern the matrices in SO(3):
(2.25)
(2.26)
Equation (2.25) follows from the fact that the columns of a rotation matrix are unit vectors, and Equation (2.26) follows from the fact that columns of a rotation matrix are mutually orthogonal. Together, these constraints define six independent equations with nine unknowns, which implies that there are three free variables.
In this section we derive three ways in which an arbitrary rotation can be represented using only three independent quantities: the Euler angle representation, the roll-pitch-yaw representation, and the axis-angle representation.
2.5.1 Euler Angles
A common method of specifying a rotation matrix in terms of three independent quantities is to use the so-called Euler angles. Consider the fixed coordinate frame o0x0y0z0 and the rotated frame o1x1y1z1 shown in Figure 2.10. We can specify the orientation of the frame o1x1y1z1 relative to the frame o0x0y0z0 by three angles (ϕ, θ, ψ), known as Euler angles, and obtained by three successive rotations as follows. First rotate about the z-axis by the angle ϕ. Next rotate about the current y-axis by the angle θ. Finally rotate about the current z-axis by the angle ψ. In Figure 2.10, frame oaxayaza represents the new coordinate frame after the rotation by ϕ, frame obxbybzb represents the new coordinate frame after the rotation by θ, and frame o1x1y1z1 represents the final frame, after the rotation by ψ. Frames oaxayaza and obxbybzb are shown in the figure only to help visualize the rotations.
Figure 2.10 Euler angle representation.
In terms of the basic rotation matrices the resulting rotational transformation can be generated as the product
(2.27)
The matrix RZYZ in Equation (2.27) is called the ZYZ–Euler angle transformation.
The more important and more difficult problem is to determine for a particular R = (rij) the set of Euler angles ϕ, θ, and ψ, that satisfy
(2.28)
for a matrix R ∈ SO(3). This problem will be important later when we address the inverse kinematics problem for manipulators in Chapter 5.
To find a solution for this problem we break it down into two cases. First, suppose that not both of r13, r23 are zero. Then from Equation (2.27) we deduce that sθ ≠ 0, and hence that not both of r31, r32 are zero. If not both r13 and r23 are zero, then r33 ≠ ±1, and we have cθ = r33,
(2.29)
or
(2.30)
where the function Atan2 is the two-argument arctangent function defined in Appendix A.
If we choose the value for θ given by Equation (2.29), then sθ > 0, and
(2.31)
(2.32)
If we choose the value for θ given by Equation (2.30), then sθ < 0, and
(2.33)
(2.34)
Thus, there are two solutions depending on the sign chosen for θ.
If r13 = r23 = 0, then the fact that
(2.35)
If r33 = 1, then cθ = 1 and sθ = 0, so that θ = 0. In this case, Equation (2.27) becomes
Thus, the sum ϕ + ψ can be determined as
(2.36)
Since only the sum ϕ + ψ can be determined in this case, there are infinitely many solutions. In this case, we may take ϕ = 0 by convention. If r33 = −1, then cθ = −1 and sθ = 0, so that θ = π. In this case Equation (2.27) becomes
(2.37)
The solution is thus
(2.38)