The Euler's theorem says that for every rotation $f\in SO(3)$ of three dimensional Euclidean space there exists a orthogonal basis $e_1, e_2,e_3$ and $\theta \in [0,\pi)$ such that $ M(f)= \left [ \begin{array}{rrr} 1 & 0 & 0 \\ 0&\cos \theta & -\sin \theta \\ 0& \sin \theta & \cos \theta \end{array} \right ] , $ where $M(f)$ is a matrice of $f$ in basis $e_1,e_2,e_3$.
How to obtain, in algebraic way, that there are $\phi, \psi \in [0,2\pi)$
such that $ M(f)=\left [ \begin{array}{rrr} \cos \phi & -\sin \phi &0 \\ \sin \phi & \cos \phi &0 \\ 0 & 0 & 1 \\ \end{array} \right ] \left [ \begin{array}{rrr} 1 & 0 & 0 \\ 0&\cos \theta & -\sin \theta \\ 0& \sin \theta & \cos \theta \end{array} \right ] \left [ \begin{array}{rrr} \cos \psi & -\sin \psi &0 \\ \sin \psi & \cos \psi &0 \\ 0 & 0 & 1 \\ \end{array} \right ]? $