User Tools


This is an old revision of the document!


3D Rotation

Note: This section is currently under revision.

3D Rotation can be accomplished in a number of ways. Computer systems often favor Quaternions for certain mathematical properties. However Quaternions are not terribly easy for humans to interpret or understand specific values.

It must be stated that rotational systems are all mathematically consistent and equally valid. The method discussed here is simply easier for use of humans.

3x3 Rotation

This system describes an arbitrary rotation in 3D space with roll, pitch, and yaw, labeled $\psi, \phi,$ and $\theta$.

Yaw $\theta$ describes rotation about z-axis. Pitch $\phi$ describes rotation about the y-axis. Roll $\psi$ describes rotation about the x-axis. All rotations described here are right-handed.

These three values can be used to generate a 3×3 orthonormal matrix, with a determinant of 1, that rotates any $\begin{bmatrix} x,y,z \end{bmatrix}$ vector.

Roll

To Roll a vector about the x-axis, left-multiply it by the rotation vector $R_\psi$.

$$ R_\psi = \begin{bmatrix} 1 & 0 & 0 \\ 0 & cos(\psi) & -sin(\psi) \\ 0 & sin(\psi) & cos(\psi) \end{bmatrix} $$

Pitch

To Pitch a vector about the y-axis, left-multiply it by the rotation vector $R_\phi$.

$$ R_\phi = \begin{bmatrix} cos(\phi) & 0 & sin(\phi) \\ 0 & 1 & 0 \\ -sin(\phi) & 0 & cos(\phi) \end{bmatrix} $$

Yaw

To Pitch a vector about the y-axis, left-multiply it by the rotation vector $R_\phi$.

$$ R_\theta = \begin{bmatrix} cos(\theta) & -sin(\theta) & 0 \\ sin(\theta) & cos(\theta) & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

Complete Rotation

A full 3D rotation includes a roll, pitch, and yaw. With these three rotations, we can describe any arbitrary orientation.

Order of operation is important. To achieve a complete rotation, the vector must be first rolled, then pitched, then yawed.

$$ R_{\psi,\phi,\theta} = R_\psi R_\phi R_\theta \\ R = \begin{bmatrix} cos(\theta) & -sin(\theta) & 0 \\ sin(\theta) & cos(\theta) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} cos(\phi) & 0 & sin(\phi) \\ 0 & 1 & 0 \\ -sin(\phi) & 0 & cos(\phi) \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & cos(\psi) & -sin(\psi) \\ 0 & sin(\psi) & cos(\psi) \end{bmatrix} \\ R = \begin{bmatrix} cos(\theta)sin(\phi) & cos(\theta)sin(\phi)sin(\psi) - sin(\theta)cos(\psi) & cos(\theta)sin(\phi)cos(\psi) + sin(\theta)sin(\psi) \\ sin(\theta)cos(\phi) & sin(\theta)sin(\phi)sin(\psi) + cos(\theta)cos(\psi) & sin(\theta)sin(\phi)cos(\psi) - cos(\theta)sin(\psi) \\ -sin(\phi) & cos(\phi)sin(\psi) & cos(\phi)cos(\psi) \end{bmatrix} $$