# Relation between rotation matrix and euler angles

I have a rotation matrix $$M$$ (so I know that $$M M^T = 1$$). I retrieve the angles with the formulae: $$\begin{array}{lll} \alpha & = & {\rm atan2}(M_{1 2}, M_{1 1}) \\ \beta & = & {\rm atan2}(- M_{1 3}, \sqrt{1 - M_{1 3}^2}) \\ \gamma & = & {\rm atan2}(M_{2 3}, M_{3 3}) \\ \end{array}$$

I have my three matrices $$R_x = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos(\gamma) & \sin( \gamma) \\ 0 & -\sin(\gamma) & \cos( \gamma) \end{bmatrix}$$

$$R_y = \begin{bmatrix} \cos(\beta) & 0 & -\sin(\beta) \\ 0 & 1 & 0 \\ \sin(\beta) & 0 & \cos(\beta) \end{bmatrix}$$ $$R_z = \begin{bmatrix} \cos(\alpha) & \sin(\alpha) & 0 \\ -\sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{bmatrix}$$

Now I want to prove that when $$0 < \cos(\beta)$$ we have

$$M = R_x R_y R_z$$

I made it for the simple cases ($$M_{1 1}$$, $$M_{1 2}$$, $$M_{1 3}$$, $$M_{2 3}$$, $$M_{3 3}$$) but I am stuck on the remaining cases. For example, how can I prove that $$M_{2 1} = \cos(\alpha) \sin(\beta) \sin(\gamma) - \sin(\alpha) \cos(\gamma)$$

• Lolo In the first three equations (defining $\alpha, \beta,$ and $\gamma$ did you mean "tan2" to mean $\tan^2$, or is the 2 a multiple of what follows? Commented May 3, 2021 at 20:49
• no I mean the function atan2 : en.wikipedia.org/wiki/Atan2
– Lolo
Commented May 3, 2021 at 20:54
• Thank you for answering, and you're welcome for the edit, accordingly. Commented May 3, 2021 at 20:57

Ok after thinking over it is sufficient to multiply both sides by $$\cos^2(\beta)$$. This leads to $$M_{2 1} (1 - M_{1 3}^2) = - M_{1 1} M_{2 3} M_{1 3} - M_{1 2} M_{2 2}$$ which can easily be checked.