Find a Guide

Directional Cosine Matrices and Euler Angles

Introduction

In previous tutorials, Aircraft Coordinate System and Anatomy and Rotation/Directional Cosine Matrices, we talked about Euler angles and directional cosine matrices, respectively. In this tutorial, we will tie this two concepts together. Let's dive in!

Connecting Concepts

In Aircraft Coordinate System and Anatomy, we had talked about Euler angles and how they detail the directionality of a plane's body frame via 3 angles, $ \phi $, $ \theta $, and $ \psi $. These angles quantify the amount a plane body's axes are rotated from the inertial frame. $ \phi $ represents the amount of roll of a plane, $ \theta $ represents the amount of pitch, and $ \psi $ represents the amount of yaw.

As for the directional cosine matrices, we learned in Rotation/Directional Cosine Matrices that these are often referred to as rotation matrices. What is interesting about rotation matrices is we can either rotate about one axis, or we can multiply in a sequence of axes, whether the axes be the same or different. And in Rotation/Directional Cosine Matrices, there are a few code examples which show this.

Now let's say we are in the inertial frame and we want to convert to the body frame using a sequence of 3-2-1, where 3 represents a rotation about the z-axis, 2 about the y-axis, and 1 about the x-axis. Then, we could assign the inertial axis position as

$$ \begin{Bmatrix} x \\ y \\ z \end{Bmatrix} $$

And the plane's body position as

$$ \begin{Bmatrix} X \\ Y \\ Z \end{Bmatrix} $$

Then we could write the transformation as

[ 1 ]

$$ \begin{Bmatrix} X \\ Y \\ Z \end{Bmatrix} = \begin{bmatrix} \text{Rot} \phi \end{bmatrix} \begin{bmatrix} \text{Rot} \theta \end{bmatrix} \begin{bmatrix} \text{Rot} \psi \end{bmatrix} \begin{Bmatrix} x \\ y \\ z \end{Bmatrix} $$

We can then expand the rotation matrices and input their corresponding Euler angle. $ \psi $ relates to yaw, which is a rotation about the z-axis, $ \theta $ relates to pitch, which is a rotation about the y-axis, and $ \phi $ relates to phi, which is a rotation about the x-axis.

[ 2 ]

$$ \begin{Bmatrix} X \\ Y \\ Z \end{Bmatrix} = \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} \begin{Bmatrix} x \\ y \\ z \end{Bmatrix} $$

Now if you were in the body frame instead and had your Euler angles, you could revert back to the inertial frame by taking the transpose of the rotation matrices, switching their sequence order, and switching the inertial and body position vectors like below.

[ 3 ]

$$ \begin{Bmatrix} x \\ y \\ z \end{Bmatrix} = \begin{bmatrix} \text{Rot} \psi \end{bmatrix}^T \begin{bmatrix} \text{Rot} \theta \end{bmatrix}^T \begin{bmatrix} \text{Rot} \phi \end{bmatrix}^T \begin{Bmatrix} X \\ Y \\ Z \end{Bmatrix} $$

I wanted to touch on this because coordinate transformations are very useful for air and spacecraft, and they happen frequently, so learning about the connection between the body frame and inertial frame will be beneficial as we go on!

Find a Guide