## What are \(\psi\), \(\theta\), and \(\phi\)?

\(\psi\), \(\theta\), and \(\phi\) are the 3-2-1 Euler angles used to describe the orientation of an aircraft or other rigid body. \(\psi\) is the heading or yaw angle, \(\theta\) is the pitch angle, and \(\phi\) is the roll angle. For this reason, the 3-2-1 set of Euler angles are also known as the yaw-pitch-roll angles.

## Rigid Body Attitude Coordinates

A *rigid body* is a solid object whose deformation is considered negligible. In the context of kinematics, a rigid body has an *orientation* or *attitude*, unlike point mass systems.

### The Direction Cosine Matrix

Consider a body-fixed reference frame \(\mathcal{B} : \{\uvec{b}_1, \uvec{b}_2, \uvec{b}_3\}\) attached to an arbitrary rigid body and an inertially-fixed reference frame \(\mathcal{N} : \{\uvec{n}_1, \uvec{n}_2, \uvec{n}_3\}\). The *direction cosine matrix* is an orthogonal matrix whose entries are the cosines of the angles between each basis vector of the two frames. If \(\alpha_{ij}\) is the angle between \(\uvec{b}_i\) and \(\uvec{n}_j\), the direction cosine matrix between the two frames is given by:
$$
[C] =
\begin{bmatrix}
\cos\alpha_{11} & \cos\alpha_{12} & \cos\alpha_{13} \\
\cos\alpha_{21} & \cos\alpha_{22} & \cos\alpha_{23} \\
\cos\alpha_{31} & \cos\alpha_{32} & \cos\alpha_{33} \\
\end{bmatrix}
$$

Alternatively, one can recognize the entries of the direction cosine matrix as the result of the Euclidean inner product (i.e. the "dot product") between the unit vectors of each reference frame: $$ [C] = \uvec{b}_i \cdot \uvec{n}_j $$ Note that the direction cosine matrix requires 9 entries to describe the relative orientation between two reference frames. Are any of these redundant?

It turns out that the answer is yes. Viewing the entries of the matrix as dot products of vectors, it follows that the direction cosine matrix must be a symmetric matrix because the dot product is commutative, that is:
$$ \vec{a} \cdot \vec{b} = \vec{b} \cdot \vec{a} $$
In all, the direction cosine matrix has 6 redundant parameters. Only three parameters are required to keep track of an orientation. One of the most common methods of parameterizing attitude are the *Euler angles*.

### The Euler Angles

The Swiss mathematician and physicist Leonhard Euler (1707-1783) introduced the set of three angles that bear his name as a non-redundant parameterization of attitude. The Euler angles are a set of three successive rotations \((\theta_1, \theta_2, \theta_3)\) about specified body axes. The axes are denoted as 1, 2, and 3. In the standard Cartesian frame, a 1-rotation corresponds to a rotation about the \(x\)-axis, a 2-rotation corresponds to a rotation about the \(y\)-axis, and a 3-rotation corresponds to a rotation about the \(z\)-axis.

The Euler angles are a compact attitude representation compared to the direction cosine matrix, but the direction cosine matrix is extremely useful for applying rotations. Rotations are linear transformations and can be represented in matrix form. Transformation matrices for finite, counterclockwise rotations about a single axis are given below. $$ [T_1(\theta)] = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\theta & \sin\theta \\ 0 & -\sin\theta & \cos\theta \\ \end{bmatrix} $$ $$ [T_2(\theta)] = \begin{bmatrix} \cos\theta & 0 & -\sin\theta \\ 0 & 1 & 0 \\ \sin\theta & 0 & \cos\theta \\ \end{bmatrix} $$ $$ [T_3(\theta)] = \begin{bmatrix} \cos\theta & \sin\theta & 0 \\ -\sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} $$ These transformation matrices can be composed in sequence to generate a direction cosine matrix for an arbitrary set of Euler angles. Consider the 3-2-1 Euler angles. These angles are, by convention, written as \((\theta_1, \theta_2, \theta_3)=(\psi, \theta, \phi)\). The 3-2-1 Euler angles are shown below:

The 3-2-1 direction cosine matrix is: $$ \begin{align*} [T_{3-2-1}(\psi, \theta, \phi)] &= [T_1(\phi)][T_2(\theta)][T_3(\psi)] \\ &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\phi & \sin\phi \\ 0 & -\sin\phi & \cos\phi \\ \end{bmatrix} \begin{bmatrix} \cos\theta & 0 & -\sin\theta \\ 0 & 1 & 0 \\ \sin\theta & 0 & \cos\theta \\ \end{bmatrix} \begin{bmatrix} \cos\psi & \sin\psi & 0 \\ -\sin\psi & \cos\psi & 0 \\ 0 & 0 & 1 \\ \end{bmatrix} \\ [T_{3-2-1}(\psi, \theta, \phi)] &= \begin{bmatrix} \cos\theta\cos\psi & \cos\theta\sin\psi & -\sin\theta \\ \sin\phi\sin\theta\cos\psi - \cos\phi\sin\psi & \sin\phi\sin\theta\sin\psi + \cos\phi\cos\psi & \sin\phi\cos\theta \\ \cos\phi\sin\theta\cos\psi + \sin\phi\sin\psi & \cos\phi\sin\theta\sin\psi - \sin\phi\cos\psi & \cos\phi\cos\theta \\ \end{bmatrix} \end{align*} $$ How do you invert the transformation? It is easy to show that a 1-2-3 rotation sequence with the negation of the original Euler angles will bring the vector or other object to its original orientation. However, there is a much better way. Recall that direction cosine matrix is orthogonal. Orthogonal matrices have an extremely useful property: $$ [C]^T[C] = 1 = [C][C]^T $$ Equivalently, $$ [C]^{-1} = [C]^T $$ Therefore the transpose of the direction cosine matrix provides the inverse of the transformation.

How does one retrieve the Euler angles from a direction cosine matrix? If the desired rotation sequence is known, the symbolic form of the direction cosine matrix can be used to derive relationships between the Euler angles and the elements of the matrix \([C]\), denoted \(C_{ij}\). Using the 3-2-1 Euler angles as an example, the following relationships can be derived:
$$
\begin{align*}
\psi &= \tan^{-1}\left(\frac{C_{12}}{C_{11}}\right) \\
\theta &= -\sin^{-1}(C_{13}) \\
\phi &= \tan^{-1}\left(\frac{C_{23}}{C_{33}}\right)
\end{align*}
$$
Are these angles unique? Examining the inverse angle relationships above, it is apparent that there are two mathematical singularities when the entries \(C_{11}\) or \(C_{33}\) are zero. This occurs when \(\theta = \pm 90^{\circ}\). This holds for *asymmetric sets* of Euler angles, where the first and last rotations are about different axes. A *symmetric set* of Euler angles has the first and third rotations about the same axis. An example of such a set are the 3-1-3 angles \((\Omega, i, \omega)\) commonly used for spacecraft. These angles have a geometric singularity when \(\theta = 0^{\circ}\) or \(180^{\circ}\).

## Other Attitude Parameters

Other coordinates to describe attitudes exist. These include the *principle angle* about the *principal rotation vector*, *Euler parameters* (also called *quaternions*), and various types of *Rodrigues parameters*