Euler angles are three angles used to describe the orientation of a rigid body, they are typically denoted $\alpha, \beta, \gamma$, these angles represent a **sequence of three elemental rotations** about the axes of some coordinate system

## Intrinsic and extrinsic rotations

### Intrinsic rotations

A set of **intrinsic rotations** represent rotations relative to the *object space* which changes after each rotation

If the axes of some coordinate system are $X,Y,Z$ (note that initially the axes are aligned with the axes of a fixed coordinate system $x,y,z$), one of the most conventional set of *intrinsic rotations* is $z-x’-z'‘$, it’s computed as follows

- perform a rotation of $\alpha$ around the $z$-axis, the resulting set of axes is $x’, y’, z'$ (note that $z’ = z$)
- perform a rotation of $\beta$ around the $x'$-axis, the resulting set of axes is $x’', y’', z'‘$ (note that $x’’ = x'$)
- perform a rotation of $\gamma$ around the $z'‘$-axis, the resulting set of axes is $x’'', y’'', z'‘‘$ (note that $z’’’ = z'‘$ and that the object space $z$-axis is used twice in the overall rotation)

A rotation matrix (used to pre-multiply column vectors) can be used to represent a sequence of *intrinsic rotations*, for example the extrinsic rotations $x-y’-z'‘$ with angles $\alpha, \beta, \gamma$ are represented as a multiplication of the following rotation matrices

Where $\mathbf{X}(\alpha)$, $\mathbf{Y}(\beta)$ and $\mathbf{Z}(\gamma)$ are rotation matrices that represent a rotation around the $x$-axis by $\alpha$, around the $y$-axis by $\beta$ and around the $z$-axis by $\gamma$ respectively

### Extrinsic rotations

A set of **extrinsic rotations** represent rotations relative to a fixed coordinate system (typically the world coordinate system), for example the set of *extrinsic rotations* $z-x-z$ works as follows

- perform a rotation of $\alpha$ around the $z$-axis, the resulting set of axes is $x’, y’, z'$ (note that $z’ = z$)
- perform a rotation of $\beta$ around the $x$-axis, the resulting set of axes is $x’', y’', z'‘$
- perform a rotation of $\gamma$ around the $z$-axis, the resulting set of axes is $x’'', y’'', z'‘‘$

A rotation matrix (used to pre-multiply column vectors) can be used to represent a sequence of *intrinsic rotations*, for example the extrinsic rotations $x-y-z$ with angles $\alpha, \beta, \gamma$ are represented as a multiplication of the following rotation matrices

Where $\mathbf{X}(\alpha)$, $\mathbf{Y}(\beta)$ and $\mathbf{Z}(\gamma)$ are rotation matrices that represent a rotation around the $x$-axis by $\alpha$, around the $y$-axis by $\beta$ and around the $z$-axis by $\gamma$ respectively

### Conversion between intrinsic rotations and extrinsic rotations

Any intrinsic rotation is equivalent to an extrinsic rotation by the same angles but with inverted order of rotations

For example the intrinsic rotations $x-y’-z'‘$ by the angles $\alpha,\beta,\gamma$ are equivalent to the extrinsic rotations $z-y-x$ by the angles $\gamma,\beta,\alpha$, both represented by

## Proper Euler angles

A sequence of three elemental rotations are called **proper Euler angles** when the first and third rotation axes are the same

There are six possibilities of choosing the rotation axes for proper Euler angles which are *intrinsic rotations* in a similar way there are other six other possibilities of choosing the rotation axes which are *extrinsic rotations*

intrinsic rotations | extrinsic rotations |
---|---|

$x-y’-x'‘$ | $x-y-x$ |

$x-z’-x'‘$ | $x-z-x$ |

$y-x’-y'‘$ | $y-x-y$ |

$y-z’-y'‘$ | $y-z-y$ |

$z-x’-z'‘$ | $z-x-z$ |

$z-y’-z'‘$ | $z-y-z$ |

## Tait-Bryan angles

A sequence of three elemental rotations are called **Tail-Bryan angles** when the angles represent rotations about three distinct axes

Just like proper Euler angles there are 6 possible *intrinsic rotations* and 6 possible *extrinsic rotations*

intrinsic rotations | extrinsic rotations |
---|---|

$x-y’-z'‘$ | $z-y-x$ |

$x-z’-y'‘$ | $y-z-x$ |

$y-x’-z'‘$ | $z-x-y$ |

$y-z’-x'‘$ | $x-z-y$ |

$z-x’-y'‘$ | $y-x-z$ |

$z-y’-x'‘$ | $x-y-z$ |

The set of *intrinsic rotations* $z-y’-x'‘$ is known as *yaw*, *pitch* and *roll*, these angles are also known as *nautical angles* because they can describe the orientation of a ship or aircraft

The rotation matrix for the sequence $z-y’-x'‘$ (or $x-y-z$) which is known as *yaw*, *pitch* and *roll* is given by

## Extrinsic rotations expressed in upright space

An important thing to note is that the standard rotation matrices work in *upright space*, if the *object space* axes are not aligned with the *upright space* axes (different direction) then the sequence of extrinsic rotations must be done on the axes expressed in *upright space*

For example given that world space is

If there’s an object whose *object space* axes $+x$ (backward), $+y$ (right) and $+z$ (up) then a sequence of intrinsic rotations $z-y’-x'‘$ by the angles $\alpha, \beta, \gamma$ (equivalent to the extrinsic rotation $x-y-z$ by the angles $\gamma, \beta, \alpha$ which is also known as *yaw*, *pitch* and *roll*) is equivalent to the multiplication of the following rotation matrices

Where

- $\mathbf{R}(\mathbf{s}, t)$ is the general rotation matrix used to rotate around the axis $\mathbf{s}$ by the angle $t$
- $\mathbf{u, v, w}$ are the columns of the transformation matrix used to transform any point $\mathbf{p}$ expressed in
*object space*to*upright space*

The problem can be simplified when frame is somewhat aligned with the *upright space* (the order might be different and the axis directions might be reversed but it’s still aligned), the following diagram shows some of these simplifications

To/from | Description | Intrinsic/Extrinsic rotations |
Equivalence in world space |
---|---|---|---|

yaw, pitch, roll | $$ \begin{align*} y-x'-z'' \\ z-x-y \end{align*} $$ | $$ \begin{align*} \mathbf{Y}(\alpha) \\ \mathbf{X}(\beta) \\ \mathbf{Z}(\gamma) \end{align*} $$ | |

yaw, pitch, roll | $$ \begin{align*} z-y'-x'' \\ x-y-z \end{align*} $$ | $$ \begin{align*} \mathbf{Z}(\alpha) \equiv \mathbf{Y_{wld}}(\alpha) \\ \mathbf{Y}(\beta) \equiv \mathbf{X_{wld}}(\beta) \\ \mathbf{X}(\gamma) \equiv \mathbf{Z_{wld}}(\gamma) \end{align*} $$ | |

yaw, pitch, roll | $$ \begin{align*} y-x'-z'' \\ z-x-y \end{align*} $$ | $$ \begin{align*} \mathbf{Y}(\alpha) \equiv \mathbf{Y_{wld}}(-\alpha) \\ \mathbf{X}(\beta) \equiv \mathbf{X_{wld}}(-\beta) \\ \mathbf{Z}(\gamma) \equiv \mathbf{Z_{wld}}(\gamma) \end{align*} $$ |

- Dunn, F. and Parberry, I. (2002). 3D math primer for graphics and game development. Plano, Tex.: Wordware Pub.
- Images taken from https://www.wikiwand.com/en/Euler_angles#/Rotation_matrix, Author: Lionel Brits