<s>[INST] How to derive the relation between Euler angles and angular velocity and get the same form as mentioned in the bellow figure How to derive the relation between Euler angles and angular velocity and get this form:
$$
\left.
\begin{cases}{}
P \\
Q\\
R \\
\end{cases}
\right\}=
\left[
\begin{array}{c}
1&0&-\sin\Theta\\
0&\cos\Phi&\cos\Theta\sin\Phi\\
0&-\sin\Phi&\cos\Theta\cos\Phi
\end{array}
\right]
\left.
\begin{cases}{}
\dot{\Phi} \\
\dot{\Theta}\\
\dot{\Psi} \\
\end{cases}
\right\}
$$
$$
\left.
\begin{cases}{}
\dot{\Phi} \\
\dot{\Theta}\\
\dot{\Psi} \\
\end{cases}
\right\}=
\left[
\begin{array}{c}
1&\sin\Phi\tan\Theta&\cos\Phi\tan\Theta\\
0&\cos\Phi&-\sin\Phi\\
0&\sin\Phi\sec\Theta&\cos\Phi\sec\Theta
\end{array}
\right]
\left.
\begin{cases}{}
P \\
Q\\
R \\
\end{cases}
\right\}
$$
 [/INST] How to derive the relation between euler angles and angular velocity 
\begin{align*}
  &\text{The equations to calculate the angular velocity $\vec{\omega}$ for a given transformation matrix $S$ are: }  \\\\
  &\left[_B^I\dot{S}\right]=\left[\tilde{\vec{\omega}}_I\right]\left[_B^I S\right]\,\quad \Rightarrow
  \left[\tilde{\vec{\omega}}_I\right]=\left[_B^I\dot{S}\right]\left[_I^B S\right]\\
 &\text{or}\\
  &\left[_B^I\dot{S}\right]=\left[_B^I S\right]\left[\tilde{\vec{\omega}}_B\right]\,\quad \Rightarrow
  \left[\tilde{\vec{\omega}}_B\right]=\left[_I^B S\right]\left[_B^I\dot{S}\right]\\
  &\text{with}\\
  &\left[_B^I S\right]\,\left[_I^B S \right]=
  \begin{bmatrix}
    1 & 0 & 0 \\
    0 & 1 & 0 \\
    0 & 0 & 1 \\
  \end{bmatrix}\\\\
  &\text{$\left[_B^I{S}\right]$ Transformation matrix between B- System and I-System }\\
  &\text{$\left[\vec{\omega}\right]_B$ Vector components  B-System}\\
  &\text{$\left[\vec{\omega}\right]_I$ Vector components  I-System and}\\
  &\tilde{\vec{\omega}}=
  \begin{bmatrix}
    0 & -\omega_z &\omega_y \\
    \omega_z & 0 & -\omega_x \\
    -\omega_y & \omega_x & 0 \\
  \end{bmatrix}\\\\
  &\textbf{Example: Transformation matrix Euler angle}\\
  &\left[_B^I{S}\right]=S_z(\psi)\,S_y(\vartheta)\,S_z(\varphi)\\
 &S_z(\psi)=\left[ \begin {array}{ccc} \cos \left( \psi \right) &-\sin \left(
\psi \right) &0\\ \sin \left( \psi \right) &\cos
 \left( \psi \right) &0\\ 0&0&1\end {array} \right]\\
&S_y(\vartheta)=\left[ \begin {array}{ccc} \cos \left( \vartheta  \right) &0&\sin
 \left( \vartheta  \right) \\ 0&1&0
\\ -\sin \left( \vartheta  \right) &0&\cos \left(
\vartheta  \right) \end {array} \right]\\
&S_z(\varphi)=\left[ \begin {array}{ccc} \cos \left( \varphi \right) &-\sin \left(
\varphi \right) &0\\ \sin \left( \varphi \right) &\cos
 \left( \varphi \right) &0\\ 0&0&1\end {array} \right]\\
&\Rightarrow\\
 &\vec{\omega}_B=
  \left[ \begin {array}{ccc} 0&\sin \left( \varphi  \right) &-\cos
 \left( \varphi  \right) \sin \left( \vartheta  \right)
\\  0&\cos \left( \varphi  \right) &\sin \left(
\varphi  \right) \sin \left( \vartheta  \right) \\  1
&0&\cos \left( \vartheta  \right) \end {array} \right]
\begin{bmatrix}
  \dot{\varphi} \\
  \dot{\vartheta}\\
  \dot{\psi} \\
\end{bmatrix}\\
&\begin{bmatrix}
  \dot{\varphi} \\
  \dot{\vartheta}\\
  \dot{\psi} \\
\end{bmatrix}=
\left[ \begin {array}{ccc} {\frac {\cos \left( \varphi  \right) \cos
 \left( \vartheta  \right) }{\sin \left( \vartheta  \right) }}&-{
\frac {\sin \left( \varphi  \right) \cos \left( \vartheta  \right) }{
\sin \left( \vartheta  \right) }}&1\\  \sin \left(
\varphi  \right) &\cos \left( \varphi  \right) &0\\
-{\frac {\cos \left( \varphi  \right) }{\sin \left( \vartheta
 \right) }}&{\frac {\sin \left( \varphi  \right) }{\sin \left(
\vartheta  \right) }}&0\end {array} \right]
\begin{bmatrix}
  \omega_x \\
  \omega_y\\
  \omega_z \\
\end{bmatrix}_B\\
&\vec{\omega}_I=
\left[ \begin {array}{ccc} \cos \left( \psi \right) \sin \left(
\vartheta  \right) &-\sin \left( \psi \right) &0\\
\sin \left( \psi \right) \sin \left( \vartheta  \right) &\cos \left(
\psi \right) &0\\  \cos \left( \vartheta  \right) &0&
1\end {array} \right]
 \begin{bmatrix}
  \dot{\varphi} \\
  \dot{\vartheta}\\
  \dot{\psi} \\
\end{bmatrix}\\
&\begin{bmatrix}
  \dot{\varphi} \\
  \dot{\vartheta}\\
  \dot{\psi} \\
\end{bmatrix}=
\left[ \begin {array}{ccc} {\frac {\cos \left( \psi \right) }{\sin
 \left( \vartheta  \right) }}&{\frac {\sin \left( \psi \right) }{\sin
 \left( \vartheta  \right) }}&0\\  -\sin \left( \psi
 \right) &\cos \left( \psi \right) &0\\  -{\frac {
\cos \left( \vartheta  \right) \cos \left( \psi \right) }{\sin \left(
\vartheta  \right) }}&-{\frac {\cos \left( \vartheta  \right) \sin
 \left( \psi \right) }{\sin \left( \vartheta  \right) }}&1\end {array}
 \right]
\begin{bmatrix}
  \omega_x \\
  \omega_y\\
  \omega_z \\
\end{bmatrix}_I
\end{align*}
</s>