$ X = \left( \begin{array}{ccc}
1 & 0 & 0 \\
0 & cos \phi & -sin \phi \\
0 & sin \phi & cos \phi \\
\end{array} \right) $

$ Y = \left( \begin{array}{ccc}
cos \theta & 0 & sin \theta \\
0 & 1 & 0 \\
-sin \theta & 0 & cos \theta \\
\end{array} \right) $

$ Z = \left( \begin{array}{ccc}
cos \psi & -sin \psi & 0 \\
sin \psi & cos \psi & 0 \\
0 & 0 & 1 \\
\end{array} \right) $


$ M = Z * Y * X $

M=\left( \begin{array}{ccc}
cos \psi & -sin \psi & 0 \\
sin \psi & cos \psi & 0 \\
0 & 0 & 1 \\
\end{array} \right)\left( \begin{array}{ccc}
cos \theta & 0 & sin \theta \\
0 & 1 & 0 \\
-sin \theta & 0 & cos \theta \\
\end{array} \right)\left( \begin{array}{ccc}
1 & 0 & 0 \\
0 & cos \phi & -sin \phi \\
0 & sin \phi & cos \phi \\
\end{array} \right) $

M=\left( \begin{array}{ccc}
cos \psi & -sin \psi & 0 \\
sin \psi & cos \psi & 0 \\
0 & 0 & 1 \\
\end{array} \right)\left( \begin{array}{ccc}
cos \theta & sin \theta sin \phi & sin \theta cos \phi \\
0 & cos \phi & -sin \phi \\
-sin \theta & cos \theta sin \phi & cos \theta cos \phi \\
\end{array} \right) $

M=\left( \begin{array}{ccc}
cos \psi cos \theta &
cos \psi sin \theta sin \phi - sin \psi cos \phi &
cos \psi sin \theta cos \phi + sin \psi sin \phi \\
sin \psi cos \theta &
sin \psi sin \theta sin \phi + cos \psi cos \phi &
sin \psi sin \theta cos \phi - cos \psi sin \phi \\
-sin \theta &
cos \theta sin \phi &
cos \theta cos \phi \\
\end{array} \right)$

\begin{alignat*}{3}
\phi &= atan(\frac{ sin \phi }{ cos \phi }) &&= atan(\frac{ M_{c1,r2} }{ M_{c2,r2} }) \\
\theta &= asin(sin \theta) &&= asin(-M_{c0,r2}) \\
\psi &= atan(\frac{ sin \psi }{ cos \psi }) &&= atan(\frac{ M_{c0,r1} }{ M_{c0,r0} }) \\
\end{alignat*}

\begin{flalign*}
sin \theta &= 1 \\
cos \theta &= 0 \\
\end{flalign*}

M=\left( \begin{array}{ccc}
0 &
cos \psi sin \phi - sin \psi cos \phi &
cos \psi cos \phi + sin \psi sin \phi \\
0 &
sin \psi sin \phi + cos \psi cos \phi &
sin \psi cos \phi - cos \psi sin \phi \\
-1 &
0 &
0 \\
\end{array} \right)$

\begin{flalign*}
sin (\phi - \psi) &= cos \psi sin \phi - sin \psi cos \phi \\
cos (\phi - \psi) &= cos \psi cos \phi + sin \psi sin \phi \\
\end{flalign*}

M=\left( \begin{array}{ccc}
0 &  sin(\phi - \psi) &  cos(\phi - \psi) \\
0 &  cos(\phi - \psi) & -sin(\phi - \psi) \\
-1 & 0 & 0 \\
\end{array} \right)$

\begin{alignat*}{3}
\phi &= atan(\frac{ sin \phi }{ cos \phi }) &&= atan(\frac{ -M_{c2,r1} }{ M_{c1,r1} }) \\
\theta &= asin(1) &&= \frac{\pi}{2} \\
\psi &= 0 &&= 0 \\
\end{alignat*}

\begin{flalign*}
sin \theta &= -1 \\
cos \theta &=  0 \\
\end{flalign*}

M=\left( \begin{array}{ccc}
0 &
-cos \psi sin \phi - sin \psi cos \phi &
-cos \psi cos \phi + sin \psi sin \phi \\
0 &
-sin \psi sin \phi + cos \psi cos \phi &
-sin \psi cos \phi - cos \psi sin \phi \\
1 &
0 &
0 \\
\end{array} \right)$

\begin{flalign*}
sin (\phi + \psi) &= cos \psi sin \phi + sin \psi cos \phi \\
cos (\phi + \psi) &= cos \psi cos \phi - sin \psi sin \phi \\
\end{flalign*}

M=\left( \begin{array}{ccc}
0 & -sin(\phi + \psi) & -cos(\phi + \psi) \\
0 &  cos(\phi + \psi) & -sin(\phi + \psi) \\
-1 & 0 & 0 \\
\end{array} \right)$

\begin{alignat*}{3}
\phi &= atan(\frac{ sin \phi }{ cos \phi }) &&= atan(\frac{ -M_{c2,r1} }{ M_{c1,r1} }) \\
\theta &= asin(-1) &&= -\frac{\pi}{2} \\
\psi &= 0 &&= 0 \\
\end{alignat*}