Euler angles and rotational transformations
I start by defining the rotation matrices. The first rotation is around the z-axis by an angle \phi, giving:
\mathbf T_z(\phi) = \begin{bmatrix} \cos(\phi) & \sin(\phi) & 0 \\ -\sin(\phi) & \cos(\phi) & 0 \\ 0 & 0 & 1 \end{bmatrix}
The second rotation is around the y-axis by an angle \theta:
\mathbf T_y(\theta) = \begin{bmatrix} \cos(\theta) & 0 & -\sin(\theta) \\ 0 & 1 & 0 \\ \sin(\theta) & 0 & \cos(\theta) \end{bmatrix}
The third and final rotation is again around the z-axis, by an angle \psi:
\mathbf T_z(\psi) = \begin{bmatrix} \cos(\psi) & \sin(\psi) & 0 \\ -\sin(\psi) & \cos(\psi) & 0 \\ 0 & 0 & 1 \end{bmatrix}
By applying these rotations sequentially, I can obtain the transformation matrix from the fixed frame to the body frame:
\mathbf M = \mathbf T_z(\psi)\mathbf T_y(\theta)\mathbf T_z(\phi)
Using these matrices, it is possible to express the unit vectors of the moving frame as functions of the fixed frame vectors. With these vector transformation, I can write the angular velocity in the fixed frame using the Euler angles and their derivatives:
\begin{aligned} \mathbf{\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 \end{aligned}
Similarly, the angular velocity in the moving frame is:
\begin{aligned} \mathbf{\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 \end{aligned}
By applying the inverse rotations, I can obtain expressions for the fixed frame coordinates as functions of the moving frame coordinates. In this case, the transformation matrix is:
\mathbf N = \mathbf M^{-1} = \mathbf T^{-1}_z(\psi)\mathbf T^{-1}_y(\theta)\mathbf T^{-1}_z(\phi)
This also provides an alternative method to compute the angular velocity.
I verify the angular velocity by applying the rotation matrices directly to the angular velocity expressed in the fixed frame. After applying the rotations sequentially, the angular velocity in the moving frame is:
\begin{aligned} \mathbf{\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 \end{aligned}
This result confirms the correctness of my approach. I also perform the same using the inverse transformations.
For more insights into this topic, you can find the details here.