Rotation Transformation Matrices
Euler Angles and Transformation Matrices
The motion of a rigid body involves both translation and rotation. While translation is uniquely defined by the movement of a single point on the body, the rotational component, though having a fixed end state, requires a convention for its description. This necessity arises because successive rotations are non-commutative, meaning that the order in which rotations are applied affects the final orientation.
Euler angles define the orientation of a rigid body using three successive rotations, moving from a space-fixed coordinate system to a body-fixed one. These rotations proceed as follows:
To visualize the rotation is is possible to imagine a gyroscope. Precession is the rotation of the gyroscope’s axis around the vertical axis (the first rotation \phi). Nutation is the tilting or leaning of the gyroscope’s axis (the second rotation \theta). The spin is the rotation of the gyroscope about its own axis (the third rotation \psi).
The order in which these rotations are applied is important. Changing the sequence will result in a different final orientation of the rigid body. A simple example can demonstrate this: rotating a book 90 degrees about the x-axis and then 90 degrees about the y-axis results in a different orientation than rotating first about the y-axis and then about the x-axis.
Understanding the motion of a rigid body requires describing its angular velocity. When a body undergoes a series of rotations, the total angular velocity can be expressed as the sum of individual angular velocities. Let’s consider a body undergoing rotations defined by Euler angles (\psi, \theta, \phi). We’ll denote the space-fixed frame as frame 0 and the body-fixed frame as frame 3. There are 2 other intermediate frame, frame 1, 2 are also considered.
The total angular velocity of frame 4 with respect to frame 0, denoted as \boldsymbol{\omega}_{3/0}, can be obtained using the angular velocity addition theorem:
\boldsymbol{\omega}_{3/0} = \boldsymbol{\omega}_{3/2} + \boldsymbol{\omega}_{2/1} + \boldsymbol{\omega}_{1/0}
This represents the sum of the angular velocity of frame 3 with respect to frame 2, the angular velocity of frame 2 with respect to frame 1 and the angular velocity of frame 1 with respect to the fix frame 0.
We can express \boldsymbol{\omega}_{3/0} in terms of the Euler angle rates:
\boldsymbol{\omega}_{3/0} = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2
To express the total angular velocity in the body-fixed frame (frame 2), we need to express the vectors \mathbf{k}_1 and \mathbf{n}_{12} in terms of the body-fixed basis vectors (\mathbf{i}_2, \mathbf{j}_2, \mathbf{k}_2).
We have the following relationships since \mathbf{n}_{12}=\mathbf{n}_{22} and \mathbf{k}_{1} = \mathbf{n}_{13}:
\begin{aligned} \mathbf n_{12} & = \sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 \\ \mathbf{n}_{21}& = \cos(\psi)\mathbf{i}_2 - \sin(\psi)\mathbf{j}_2 \\ \mathbf{k}_1 & = -\sin(\theta)\mathbf{n}_{21} + \cos(\theta) \mathbf{n}_{13} \\ & = -\sin(\theta) \cos(\psi) \mathbf i_2 + \sin(\theta)\sin(\psi) \mathbf j_2 + \cos(\theta) \mathbf k_2 \end{aligned}
Substituting these expressions into the equation for \boldsymbol{\omega}_{3/0}, we get:
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2 \\ & = \dot{\phi}(-\sin(\theta) \cos(\psi) \mathbf i_2 + \sin(\theta)\sin(\psi) \mathbf j_2 + \cos(\theta) \mathbf k_2) + \dot{\theta}(\sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 ) + \dot{\psi}\mathbf{k}_2 \\ & = -\dot{\phi}\sin(\theta) \cos(\psi) \mathbf i_2 + \dot{\phi}\sin(\theta)\sin(\psi) \mathbf j_2 + \dot{\phi}\cos(\theta) \mathbf k_2 + \dot{\theta}\sin(\psi)\mathbf i_2 + \dot{\theta}\cos(\psi)\mathbf j_2 + \dot{\psi}\mathbf{k}_2 \\ & = (\sin(\psi)\dot{\theta} - \sin(\theta)\cos(\psi)\dot{\phi})\mathbf{i}_2 + (\cos(\psi)\dot{\theta} + \sin(\theta)\sin(\psi)\dot{\phi})\mathbf{j}_2 + (\dot{\psi} + \cos(\theta)\dot{\phi})\mathbf{k}_2 \end{aligned}
Now, let’s express the angular velocity in the space-fixed frame (frame 0). We start with the same expression for the total angular velocity:
\boldsymbol{\omega}_{3/0} = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2
This time, we want to express \mathbf{n}_{12} and \mathbf{k}_2 in terms of the space-fixed basis vectors (\mathbf{i}_1, \mathbf{j}_1, \mathbf{k}_1). We have the following relationships:
\begin{aligned} & \mathbf n_{12} = -\sin(\phi)\mathbf{i}_1 + \cos(\phi)\mathbf{j}_1 \\ & \mathbf k_2 = \sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1 \end{aligned}
Substituting these expressions into the equation for \boldsymbol{\omega}_{3/0}, we get:
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2 \\ & = \dot{\phi}\mathbf{k}_1 + \dot{\theta}(- \sin(\phi)\mathbf{i}_1 + \cos(\phi)\mathbf{j}_1) + \dot{\psi}(\sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1) \\ & = \dot{\phi}\mathbf{k}_1 - \dot{\theta}\sin(\phi)\mathbf{i}_1 + \dot{\theta}\cos(\phi)\mathbf{j}_1 + \dot{\psi}\sin(\theta) \cos(\phi) \mathbf i_1 + \dot{\psi}\sin(\theta)\sin(\phi) \mathbf j_1 + \dot{\psi}\cos(\theta) \mathbf k_1 \\ & = (-\dot{\theta}\sin(\phi) + \dot{\psi}\sin(\theta) \cos(\phi)) \mathbf i_1 + (\dot{\theta}\cos(\phi) + \dot{\psi}\sin(\theta)\sin(\phi)) \mathbf j_1 + (\dot{\phi} + \dot{\psi}\cos(\theta)) \mathbf k_1 \end{aligned}
Rotation matrices offer an efficient method for performing rotations, automating step-by-step methods like those involving Euler angles.
Consider a frame 1, with axes \mathbf I, \mathbf J, and \mathbf K, which is rotated to a new frame 2 with axes \mathbf i, \mathbf j, and \mathbf k, through an angle \alpha about the \mathbf K (or \mathbf k) axis.
A vector \mathbf u can be expressed in both frames, in frame 1 as:
\mathbf u = u_X \mathbf I + u_Y \mathbf J + u_Z \mathbf K
and in frame 2 as:
\mathbf u = u_x \mathbf i + u_y \mathbf j + u_z \mathbf k
Projecting the vector \mathbf u onto the axes of frame 2, we get:
\begin{aligned} u_x & = \mathbf u \cdot \mathbf i = u_X \cos(\alpha) + u_Y \sin(\alpha)\\ u_y & = \mathbf u \cdot \mathbf j = -u_X \sin(\alpha) + u_Y \cos(\alpha)\\ u_z & = \mathbf u \cdot \mathbf k = u_Z \end{aligned}
These equations can be represented in matrix form as:
\begin{bmatrix} u_x \\ u_y \\ u_z \end{bmatrix} = \begin{bmatrix} \cos(\alpha) & \sin(\alpha) & 0 \\ -\sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} u_X \\ u_Y \\ u_Z \end{bmatrix}
Or in compact form:
\mathbf u\big|_2 = \mathbf T_z \mathbf u\big|_1
where the matrix is called the rotation transformation matrix about the z-axis. The rotation transformation matrix for a rotation about an arbitrary x-axis by an angle \alpha is:
\mathbf T_x = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos(\alpha) & \sin(\alpha) \\ 0 & -\sin(\alpha) & \cos(\alpha) \end{bmatrix}
and for rotation about the y-axis by an angle \alpha is:
\mathbf T_y = \begin{bmatrix} \cos(\alpha) & 0 & -\sin(\alpha) \\ 0 & 1 & 0 \\ \sin(\alpha) & 0 & \cos(\alpha) \end{bmatrix}
These rotation transformation matrices are orthonormal, meaning that the transpose of the matrix is equal to its inverse: T^T = T^{-1}.
These matrices express passive rotations, meaning they describe how the coordinates of a fixed vector change when viewed from a different coordinate system. When frame 2 is obtained by rotating frame 1 by an angle \alpha, these matrices transform the coordinates of a vector from its representation in frame 1 to its representation in frame 2, while the vector itself remains stationary.
This is in contrast to active rotations, which would describe how a vector’s coordinates change when the vector itself is physically rotated while keeping the coordinate system fixed.
To convert from passive to active rotation matrices, simply transpose them (or equivalently, change the signs of all sine terms). So if \mathbf T is a passive rotation matrix, then \mathbf R = \mathbf T^T is the corresponding active rotation matrix that rotates vectors by the same angle but in the opposite direction:
\begin{aligned} \mathbf R_x & = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos(\alpha) & -\sin(\alpha) \\ 0 & \sin(\alpha) & \cos(\alpha) \end{bmatrix} \\ \mathbf R_y & = \begin{bmatrix} \cos(\alpha) & 0 & \sin(\alpha) \\ 0 & 1 & 0 \\ -\sin(\alpha) & 0 & \cos(\alpha) \end{bmatrix} \\ \mathbf R_z & = \begin{bmatrix} \cos(\alpha) & -\sin(\alpha) & 0 \\ \sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{bmatrix} \end{aligned}
It is possible as example to derive in a systematic way the transformation from the fix frame to the moving 7 frame using the transformation matrices and applying to the previously derived formula for the angular velocity.
As first, we will move from the fix frame to the body frame, applying three consecutive rotations through Euler angles \phi, \theta, and \psi. Starting with angular velocity in frame 1, we transform to frame 2 through rotation matrices.
Lets work on the transformation of the coordinates.
Going from the frame 0 to frame 1:
\begin{aligned} \mathbf M_1 & = \begin{bmatrix} \mathbf n_{11} \\ \mathbf n_{12} \\ \mathbf n_{13} \end{bmatrix} = \mathbf T_z(\phi) \begin{bmatrix} \mathbf i_1 \\ \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} = \begin{bmatrix} \cos(\phi) & \sin(\phi) & 0 \\ -\sin(\phi) & \cos(\phi) & 0 \\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} \mathbf i_1 \\ \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} \\ = & \begin{bmatrix} \cos(\phi) \mathbf i_1 + \sin(\phi) \mathbf j_1 \\ -\sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} \end{aligned}
Going from the frame 1 to frame 2:
\begin{aligned} \mathbf M_2 & = \begin{bmatrix} \mathbf n_{21} \\ \mathbf n_{22} \\ \mathbf n_{33} \end{bmatrix} = \mathbf T_y(\theta) \begin{bmatrix} \mathbf n_{11} \\ \mathbf n_{12} \\ \mathbf n_{13} \end{bmatrix} = \mathbf T_y(\theta) \mathbf M_1\\ & = \begin{bmatrix} \cos(\theta) & 0 & -\sin(\theta) \\ 0 & 1 & 0 \\ \sin(\theta) & 0 & \cos(\theta) \end{bmatrix} \begin{bmatrix} \cos(\phi) \mathbf i_1 + \sin(\phi) \mathbf j_1 \\ -\sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} \\ \\ \\ = & \begin{bmatrix} \cos(\theta) ( \cos(\phi) \mathbf i_1 + \sin(\phi) \mathbf j_1 ) - \sin(\theta) \mathbf k_1 \\ \sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 \\ \sin(\theta)( \cos(\phi) \mathbf i_1 + \sin(\phi) \mathbf j_1 ) + \cos(\theta) \mathbf k_1 \end{bmatrix} \\ = & \begin{bmatrix} \cos(\theta) \cos(\phi) \mathbf i_1 + \cos(\theta) \sin(\phi)\mathbf j_1 - \sin(\theta) \mathbf k_1 \\ -\sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 \\ \sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1 \end{bmatrix} \\ = & \begin{bmatrix} \cos(\theta) \cos(\phi) & \cos(\theta) \sin(\phi) & -\sin(\theta) \\ -\sin(\phi) & \cos(\phi) & 0 \\\sin(\theta) \cos(\phi) & \sin(\theta)\sin(\phi) & \cos(\theta) \end{bmatrix} \begin{bmatrix} \mathbf i_1 \\ \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} \end{aligned}
Finally, going from frame 2 to frame 3:
\begin{aligned} \mathbf M_3 & = \begin{bmatrix} \mathbf i_2 \\ \mathbf j_2 \\ \mathbf k_2 \end{bmatrix} = \mathbf T_z(\psi) \begin{bmatrix} \mathbf n_{21} \\ \mathbf n_{22} \\ \mathbf n_{33} \end{bmatrix} = \mathbf T_z(\psi) \mathbf M_2 \\ & = \begin{bmatrix} \cos(\psi) & \sin(\psi) & 0 \\ -\sin(\psi) & \cos(\psi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \cos(\theta) \cos(\phi) \mathbf i_1 + \cos(\theta) \sin(\phi)\mathbf j_1 - \sin(\theta) \mathbf k_1 \\ -\sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 \\ \sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\psi)(\cos(\theta) \cos(\phi) \mathbf i_1 + \cos(\theta) \sin(\phi)\mathbf j_1 - \sin(\theta) \mathbf k_1) + \sin(\psi)(-\sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 ) \\ -\sin(\psi) (\cos(\theta) \cos(\phi) \mathbf i_1 + \cos(\theta) \sin(\phi)\mathbf j_1 - \sin(\theta) \mathbf k_1) + \cos(\psi) (-\sin(\phi)\mathbf i_1 + \cos(\phi) \mathbf j_1 ) \\ \sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\psi)\cos(\theta) \cos(\phi) \mathbf i_1 + \cos(\psi)\cos(\theta) \sin(\phi)\mathbf j_1 - \cos(\psi)\sin(\theta) \mathbf k_1 -\sin(\psi)\sin(\phi)\mathbf i_1 + \sin(\psi)\cos(\phi) \mathbf j_1 \\ - \sin(\psi)\cos(\theta) \cos(\phi) \mathbf i_1 - \sin(\psi)\cos(\theta) \sin(\phi)\mathbf j_1 + \sin(\psi)\sin(\theta) \mathbf k_1 - \cos(\psi)\sin(\phi)\mathbf i_1 + \cos(\psi)\cos(\phi) \mathbf j_1 \\ \sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1 \end{bmatrix} \\ & = \begin{bmatrix}\cos(\psi)\cos(\theta) \cos(\phi)-\sin(\psi)\sin(\phi) & \cos(\psi)\cos(\theta) \sin(\phi) + \sin(\psi)\cos(\phi) & -\cos(\psi)\sin(\theta) \\ -\sin(\psi)\cos(\theta) \cos(\phi) -\cos(\psi)\sin(\phi) & -\sin(\psi)\cos(\theta) \sin(\phi) + \cos(\psi)\cos(\phi) & \sin(\psi)\sin(\theta)\\ \sin(\theta) \cos(\phi) & \sin(\theta)\sin(\phi) & \cos(\theta) \end{bmatrix} \begin{bmatrix} \mathbf i_1 \\ \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} \end{aligned}
As we have all the unitary vectors as function of the fixed frame, we can easily compute the angular velocity. Starting from the definition:
\boldsymbol{\omega}_{3/0} = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2
Using the computed vectors from above:
\begin{aligned} & \mathbf n_{12} = -\sin(\phi)\mathbf{i}_1 + \cos(\phi)\mathbf{j}_1 \\ & \mathbf k_2 = \sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1 \end{aligned}
Substituting:
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2 \\ & = \dot{\phi}\mathbf{k}_1 + \dot{\theta}(- \sin(\phi)\mathbf{i}_1 + \cos(\phi)\mathbf{j}_1) + \dot{\psi}(\sin(\theta) \cos(\phi) \mathbf i_1 + \sin(\theta)\sin(\phi) \mathbf j_1 + \cos(\theta) \mathbf k_1) \\ & = \dot{\phi}\mathbf{k}_1 - \dot{\theta}\sin(\phi)\mathbf{i}_1 + \dot{\theta}\cos(\phi)\mathbf{j}_1 + \dot{\psi}\sin(\theta) \cos(\phi) \mathbf i_1 + \dot{\psi}\sin(\theta)\sin(\phi) \mathbf j_1 + \dot{\psi}\cos(\theta) \mathbf k_1 \\ & = (-\dot{\theta}\sin(\phi) + \dot{\psi}\sin(\theta) \cos(\phi)) \mathbf i_1 + (\dot{\theta}\cos(\phi) + \dot{\psi}\sin(\theta)\sin(\phi)) \mathbf j_1 + (\dot{\phi} + \dot{\psi}\cos(\theta)) \mathbf k_1 \end{aligned}
Which matches the results from the previous geometric analysis.
Using the inverse transformations, it is also possible to compute all coordinate as function of the coordinates in reference frame 3. Going from frame 3 to frame 2:
\begin{aligned} \mathbf N_3 & \begin{bmatrix} \mathbf n_{21} \\ \mathbf n_{22} \\ \mathbf n_{33} \end{bmatrix} = \mathbf T^{-1}_z(\psi) \begin{bmatrix} \mathbf i_2 \\ \mathbf j_2 \\ \mathbf k_2 \end{bmatrix} = \begin{bmatrix} \cos(\psi) & -\sin(\psi) & 0 \\ \sin(\psi) & \cos(\psi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \mathbf i_2 \\ \mathbf j_2 \\ \mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\psi)\mathbf i_2 - \sin(\psi)\mathbf j_2 \\ \sin(\psi)\mathbf i_2 +\cos(\psi)\mathbf j_2 \\ \mathbf k_2 \end{bmatrix} \end{aligned}
Going from frame 2 to frame 1:
\begin{aligned} \mathbf N_2 & = \begin{bmatrix} \mathbf n_{11} \\ \mathbf n_{12} \\ \mathbf n_{13} \end{bmatrix} = \mathbf T^{-1}_y(\theta) \begin{bmatrix} \mathbf n_{21} \\ \mathbf n_{22} \\ \mathbf n_{33} \end{bmatrix} = \mathbf T^{-1}_y(\theta) \mathbf N_3 \\ & = \begin{bmatrix} \cos(\theta) & 0 & \sin(\theta) \\ 0 & 1 & 0 \\ -\sin(\theta) & 0 & \cos(\theta) \end{bmatrix}\begin{bmatrix} \cos(\psi)\mathbf i_2 - \sin(\psi)\mathbf j_2 \\ \sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 \\ \mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\theta)(\cos(\psi)\mathbf i_2 - \sin(\psi)\mathbf j_2) + \sin(\theta) \mathbf k_2 \\ \sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 \\ -\sin(\theta)(\cos(\psi)\mathbf i_2 - \sin(\psi)\mathbf j_2) + \cos(\theta)\mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\theta)\cos(\psi)\mathbf i_2 - \cos(\theta)\sin(\psi)\mathbf j_2 + \sin(\theta) \mathbf k_2 \\ \sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 \\ -\sin(\theta)\cos(\psi)\mathbf i_2 + \sin(\theta)\sin(\psi)\mathbf j_2 + \cos(\theta)\mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\theta)\cos(\psi) & -\cos(\theta)\sin(\psi) & \sin(\theta) \\ \sin(\psi) & \cos(\psi) & 0 \\ -\sin(\theta)\cos(\psi) & \sin(\theta)\sin(\psi) & \cos(\theta) \end{bmatrix} \begin{bmatrix} \mathbf i_2 \\ \mathbf j_2 \\ \mathbf k_2 \end{bmatrix} \end{aligned}
Finally, going from frame 1 to the fix frame 0:
\begin{aligned} \mathbf N_1 & = \begin{bmatrix} \mathbf i_1 \\ \mathbf j_1 \\ \mathbf k_1 \end{bmatrix} = \mathbf T^{-1}_z(\phi) \begin{bmatrix} \mathbf n_{11} \\ \mathbf n_{12} \\ \mathbf n_{13} \end{bmatrix} = \mathbf T^{-1}_z(\phi) \mathbf N_2 \\ & = \begin{bmatrix} \cos(\phi) & -\sin(\phi) & 0 \\ \sin(\phi) & \cos(\phi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \cos(\theta)\cos(\psi)\mathbf i_2 - \cos(\theta)\sin(\psi)\mathbf j_2 + \sin(\theta) \mathbf k_2 \\ \sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 \\ -\sin(\theta)\cos(\psi)\mathbf i_2 + \sin(\theta)\sin(\psi)\mathbf j_2 + \cos(\theta)\mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\phi)(\cos(\theta)\cos(\psi)\mathbf i_2 - \cos(\theta)\sin(\psi)\mathbf j_2 + \sin(\theta) \mathbf k_2) - \sin(\phi)(\sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2) \\ \sin(\phi)(\cos(\theta)\cos(\psi)\mathbf i_2 - \cos(\theta)\sin(\psi)\mathbf j_2 + \sin(\theta) \mathbf k_2) + \cos(\phi)(\sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2) \\ -\sin(\theta)\cos(\psi)\mathbf i_2 + \sin(\theta)\sin(\psi)\mathbf j_2 + \cos(\theta)\mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\phi)\cos(\theta)\cos(\psi)\mathbf i_2 - \cos(\phi)\cos(\theta)\sin(\psi)\mathbf j_2 + \cos(\phi)\sin(\theta) \mathbf k_2 -\sin(\phi)\sin(\psi)\mathbf i_2 - \sin(\phi)\cos(\psi)\mathbf j_2 \\ \sin(\phi)\cos(\theta)\cos(\psi)\mathbf i_2 -\sin(\phi)\cos(\theta)\sin(\psi)\mathbf j_2 + \sin(\phi)\sin(\theta) \mathbf k_2 + \cos(\phi)\sin(\psi)\mathbf i_2 + \cos(\phi)\cos(\psi)\mathbf j_2 \\- \sin(\theta)\cos(\psi)\mathbf i_2 + \sin(\theta)\sin(\psi)\mathbf j_2 + \cos(\theta)\mathbf k_2 \end{bmatrix} \\ & = \begin{bmatrix} \cos(\phi)\cos(\theta)\cos(\psi) -\sin(\phi)\sin(\psi) & -\cos(\phi)\cos(\theta)\sin(\psi) - \sin(\phi)\cos(\psi) & \cos(\phi)\sin(\theta) \\ \sin(\phi)\cos(\theta)\cos(\psi) + \cos(\phi)\sin(\psi) & -\sin(\phi)\cos(\theta)\sin(\psi) + \cos(\phi)\cos(\psi) & \sin(\phi)\sin(\theta) \\ -\sin(\theta)\cos(\psi) & \sin(\theta)\sin(\psi) & \cos(\theta) \end{bmatrix} \begin{bmatrix} \mathbf i_2 \\ \mathbf j_2 \\ \mathbf k_2 \end{bmatrix} \end{aligned}
With these results it is possible to compute the angular velocity in frame 3:
\boldsymbol{\omega}_{3/0} = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2
Using the computed vectors from above:
\begin{aligned} & \mathbf n_{12} = \sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 \\ & \mathbf k_1 = -\sin(\theta) \cos(\psi) \mathbf i_2 + \sin(\theta)\sin(\psi) \mathbf j_2 + \cos(\theta) \mathbf k_2 \end{aligned}
Substituting:
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \dot{\phi}\mathbf{k}_1 + \dot{\theta}\mathbf{n}_{12} + \dot{\psi}\mathbf{k}_2 \\ & = \dot{\phi}(-\sin(\theta) \cos(\psi) \mathbf i_2 + \sin(\theta)\sin(\psi) \mathbf j_2 + \cos(\theta) \mathbf k_2) + \dot{\theta}(\sin(\psi)\mathbf i_2 + \cos(\psi)\mathbf j_2 ) + \dot{\psi}\mathbf{k}_2 \\ & = -\dot{\phi}\sin(\theta) \cos(\psi) \mathbf i_2 + \dot{\phi}\sin(\theta)\sin(\psi) \mathbf j_2 + \dot{\phi}\cos(\theta) \mathbf k_2 + \dot{\theta}\sin(\psi)\mathbf i_2 + \dot{\theta}\cos(\psi)\mathbf j_2 + \dot{\psi}\mathbf{k}_2 \\ & = (\sin(\psi)\dot{\theta} - \sin(\theta)\cos(\psi)\dot{\phi})\mathbf{i}_2 + (\cos(\psi)\dot{\theta} + \sin(\theta)\sin(\psi)\dot{\phi})\mathbf{j}_2 + (\dot{\psi} + \cos(\theta)\dot{\phi})\mathbf{k}_2 \end{aligned}
Which also matches the results from the previous geometric analysis.
As exercise, it is possible to derive the angular velocity on frame 3 using the rotation matrices. We use the velocity just derived.
The first rotation (precession) is around the z-axis of an angle \phi:
\begin{aligned} \mathbf T_z(\phi)\boldsymbol{\omega}_{3/0} & = \begin{bmatrix} \cos(\phi) & \sin(\phi) & 0 \\ -\sin(\phi) & \cos(\phi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} -\sin(\phi)\dot{\theta} + \sin(\theta) \cos(\phi)\dot{\psi} \\ \cos(\phi)\dot{\theta} + \sin(\theta)\sin(\phi)\dot{\psi} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \\ \\ \\ & = \begin{bmatrix} \cos(\phi) (-\sin(\phi)\dot{\theta} + \sin(\theta)\cos(\phi)\dot{\psi}) + \sin(\phi) (\cos(\phi)\dot{\theta} + \sin(\theta)\sin(\phi)\dot{\psi}) \\ \sin(\phi) (\sin(\phi)\dot{\theta} - \sin(\theta)\cos(\phi)\dot{\psi}) + \cos(\phi) (\cos(\phi)\dot{\theta} + \sin(\theta)\sin(\phi)\dot{\psi}) \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix}\\ & = \begin{bmatrix} -\cos(\phi)\sin(\phi)\dot{\theta} + \sin(\theta)\cos^2(\phi)\dot{\psi} + \sin(\phi)\cos(\phi)\dot{\theta} + \sin(\theta)\sin^2(\phi)\dot{\psi} \\ \sin^2(\phi)\dot{\theta} -\sin(\phi)\sin(\theta)\cos(\phi)\dot{\psi} +\cos^2(\phi)\dot{\theta} + \cos(\phi) \sin(\theta)\sin(\phi)\dot{\psi} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \\ & = \begin{bmatrix} \sin(\theta)\dot{\psi} \\ \dot{\theta} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \end{aligned}
The second rotation (nutation) is around the-y axis of an angle \theta:
\begin{aligned} \mathbf T_y(\theta) \mathbf T_z(\phi)\boldsymbol{\omega}_{3/0} & = \begin{bmatrix} \cos(\theta) & 0 & -\sin(\theta) \\ 0 & 1 & 0 \\ \sin(\theta) & 0 & \cos(\theta) \end{bmatrix} \begin{bmatrix} \sin(\theta)\dot{\psi} \\ \dot{\theta} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \\ & = \begin{bmatrix} \cos(\theta)\sin(\theta)\dot{\psi} - \sin(\theta)(\dot{\phi} + \cos(\theta)\dot{\psi}) \\ \dot{\theta} \\ \sin^2(\theta)\dot{\psi} + \cos(\theta)(\dot{\phi} + \cos(\theta)\dot{\psi}) \end{bmatrix}\\ & = \begin{bmatrix} \cos(\theta)\sin(\theta)\dot{\psi} - \sin(\theta)\dot{\phi} - \sin(\theta)\cos(\theta)\dot{\psi} \\ \dot{\theta} \\ \sin^2(\theta)\dot{\psi} + \cos(\theta)\dot{\phi} + \cos^2(\theta)\dot{\psi} \end{bmatrix} \\ & = \begin{bmatrix} -\sin(\theta)\dot{\phi} \\ \dot{\theta} \\ \dot{\psi} + \cos(\theta)\dot{\phi} \end{bmatrix} \end{aligned}
The final rotation (spin) is around the z-axis:
\begin{aligned} \mathbf T_z(\psi) \mathbf T_y(\theta) \mathbf T_z(\phi)\boldsymbol{\omega}_{3/0} & = \begin{bmatrix} \cos(\psi) & \sin(\psi) & 0 \\ -\sin(\psi) & \cos(\psi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} -\sin(\theta)\dot{\phi} \\ \dot{\theta} \\ \dot{\psi} + \cos(\theta)\dot{\phi} \end{bmatrix} \\ & = \begin{bmatrix} -\cos(\psi)\sin(\theta)\dot{\phi} + \sin(\psi)\dot{\theta} \\ \sin(\psi)\sin(\theta)\dot{\phi} + \cos(\psi)\dot{\theta} \\ \dot{\psi} + \cos(\theta)\dot{\phi} \end{bmatrix} \end{aligned}
After applying all transformations, the angular velocity in frame 3 becomes:
\boldsymbol{\omega}_{3/0} = (\sin(\psi)\dot{\theta} - \sin(\theta)\cos(\psi)\dot{\phi})\mathbf{i}_2 + (\cos(\psi)\dot{\theta} + \sin(\theta)\sin(\psi)\dot{\phi})\mathbf{j}_2 + (\dot{\psi} + \cos(\theta)\dot{\phi})\mathbf{k}_2 This result matches the expected form when derived through direct geometric analysis, confirming the validity of our matrix transformation approach.
It is possible to work in the opposite, starting from the body frame and apply the inverse rotation to derive the expression in the fix frame. Starting from the angular velocity in frame 3 just calculated.
The first step is to rotate of -\psi along the z-axis; this is equivalent perform an inverse rotation, which is easier in place of keep inverting the sign of \sin(\alpha):
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \boldsymbol{\omega}_{3/0} \mathbf T^{-1}_z(\psi) = \begin{bmatrix} \cos(\psi) & -\sin(\psi) & 0 \\ \sin(\psi) & \cos(\psi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \sin(\psi)\dot{\theta} - \sin(\theta)\cos(\psi)\dot{\phi} \\ \cos(\psi)\dot{\theta} + \sin(\theta)\sin(\psi)\dot{\phi} \\ \dot{\psi} + \cos(\theta)\dot{\phi}\end{bmatrix} \\ & = \begin{bmatrix} \cos(\psi)(\sin(\psi)\dot{\theta} - \sin(\theta)\cos(\psi)\dot{\phi} ) - \sin(\psi) (\cos(\psi)\dot{\theta} + \sin(\theta)\sin(\psi)\dot{\phi} ) \\ \sin(\psi) (\sin(\psi)\dot{\theta} - \sin(\theta)\cos(\psi)\dot{\phi} ) + \cos(\psi)(\cos(\psi)\dot{\theta} + \sin(\theta)\sin(\psi)\dot{\phi}) \\ \dot{\psi} + \cos(\theta)\dot{\phi}\end{bmatrix} \\ & = \begin{bmatrix} \cos(\psi)\sin(\psi)\dot{\theta} - \sin(\theta)\cos^2(\psi)\dot{\phi} - \sin(\psi)\cos(\psi)\dot{\theta} -\sin(\theta)\sin^2(\psi)\dot{\phi} \\ \sin^2(\psi)\dot{\theta} - \sin(\psi)\sin(\theta)\cos(\psi)\dot{\phi} + \cos^2(\psi)\dot{\theta} + \cos(\psi)\sin(\theta)\sin(\psi)\dot{\phi} \\ \dot{\psi} + \cos(\theta)\dot{\phi}\end{bmatrix} \\ & = \begin{bmatrix} -\sin(\theta)\dot{\phi} \\ \dot{\theta} \\ \dot{\psi} + \cos(\theta)\dot{\phi}\end{bmatrix} \end{aligned}
The second step is a inverse rotation along the y-axis of an angle \theta:
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \boldsymbol{\omega}_{3/0} \mathbf T^{-1}_z(\psi) \mathbf T^{-1}_y(\theta) = \begin{bmatrix} \cos(\theta) & 0 & \sin(\theta) \\ 0 & 1 & 0 \\ -\sin(\theta) & 0 & \cos(\theta) \end{bmatrix} \begin{bmatrix} -\sin(\theta)\dot{\phi} \\ \dot{\theta} \\ \dot{\psi} + \cos(\theta)\dot{\phi}\end{bmatrix} \\ & = \begin{bmatrix} -\cos(\theta)\sin(\theta)\dot{\phi} + \sin(\theta)(\dot{\psi} + \cos(\theta)\dot{\phi}) \\ \dot{\theta} \\ \sin^2(\theta)\dot{\phi} + \cos(\theta)(\dot{\psi} + \cos(\theta)\dot{\phi})\end{bmatrix} \\ & = \begin{bmatrix} -\cos(\theta)\sin(\theta)\dot{\phi} + \sin(\theta)\dot{\psi} + \sin(\theta)\cos(\theta)\dot{\phi} \\ \dot{\theta} \\ \sin^2(\theta)\dot{\phi} + \cos(\theta)\dot{\psi} + \cos^2(\theta)\dot{\phi}\end{bmatrix} \\ & = \begin{bmatrix} \sin(\theta)\dot{\psi} \\ \dot{\theta} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \end{aligned}
The final step is an inverse rotation along the z-axis of an angle \phi:
\begin{aligned} \boldsymbol{\omega}_{3/0} & = \boldsymbol{\omega}_{3/0} \mathbf T^{-1}_z(\psi) \mathbf T^{-1}_y(\theta) \mathbf T^{-1}_z(\phi) = \begin{bmatrix} \cos(\phi) & -\sin(\phi) & 0 \\ \sin(\phi) & \cos(\phi) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \sin(\theta)\dot{\psi} \\ \dot{\theta} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \\ & = \begin{bmatrix} \cos(\phi)\sin(\theta)\dot{\psi} - \sin(\phi)\dot{\theta} \\ \sin(\phi)\sin(\theta)\dot{\psi} + \cos(\phi)\dot{\theta} \\ \dot{\phi} + \cos(\theta)\dot{\psi} \end{bmatrix} \end{aligned}
This gives the angular velocity in frame 0:
\boldsymbol {\omega}_{3/0} = (-\dot{\theta}\sin(\phi) +\dot{\psi}\sin(\theta) \cos(\phi)) \mathbf i_1 + (\dot{\theta}\cos(\phi) + \dot{\psi}\sin(\theta)\sin(\phi)) \mathbf j_1 + (\dot{\phi} + \dot{\psi}\cos(\theta)) \mathbf k_1