Combining rotations

Each of (3.16), (3.17), and (3.18) provides a single DOF of rotations. The yaw, pitch, and roll rotations can be combined sequentially to attain any possible 3D rotation:

$\displaystyle R(\alpha,\beta,\gamma) = R_y(\alpha) R_x(\beta) R_z(\gamma) .$ (3.19)

In this case, the ranges of $ \alpha$ and $ \gamma $ are from 0 to $ 2 \pi$; however, the pitch $ \beta$ need only range from $ -\pi/2$ to $ \pi/2$ while nevertheless reaching all possible 3D rotations.

Be extra careful when combining rotations in a sequence because the operations are not commutative. For example, a yaw by $ \pi/2$ followed by a pitch by $ \pi/2$ does not produce the same result as the pitch followed by the yaw. You can easily check this by substituting $ \pi/2$ into (3.17) and (3.18), and observing how the result depends on the order of matrix multiplication. The 2D case is commutative because the rotation axis is always the same, allowing the rotation angles to additively combine. Having the wrong matrix ordering is one of the most frustrating problems when writing software for VR.

Steven M LaValle 2020-01-06