# It a rotation matrix in 3D space a product of three basic rotations?

Let $$R_x(\theta) =\begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta \\ \end{bmatrix}$$

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

$$R_z(\theta) = \begin{bmatrix} \cos \theta & -\sin \theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}$$ be the basic rotation matrices rotate vectors by an angle $$\theta$$ about the $$x-$$, $$y-$$, or $$z-$$ axis, in three dimensions. For every $$A\in SO(3)$$, does there have to be $$\theta_1,\theta_2,\theta_3\in\mathbb{R}$$ such that $$A=R_x(\theta_1)R_y(\theta_2)R_z(\theta_3).$$

• Yes, this is known to be true. It's difficult to find an online reference and states and proves this directly; the closest I've come is this section of a relevant wikipedia page. Commented Mar 5 at 17:43

Let

$$R_x = \begin{bmatrix} 1 && 0 && 0 \\ 0 && c_1 && - s_1 \\ 0 && s_1 && c_1 \end{bmatrix}$$

where $$c_1 = \cos \theta_1 , s_1 = \sin \theta_1$$

$$R_y = \begin{bmatrix} c_2 && 0 && s_2 \\ 0 && 1 && 0 \\ -s_2 && 0 && c_2 \end{bmatrix}$$

where $$c_2 = \cos \theta_2 , s_2 = \sin \theta_2$$

$$R_z = \begin{bmatrix} c_3 && -s_3 && 0 \\ s_3 && c_3 && 0 \\ 0 && 0 && 1 \end{bmatrix}$$

where $$c_3 = \cos \theta_3 , s_3 = \sin \theta_3$$, then

$$R_x R_y R_z = \begin{bmatrix} 1 && 0 && 0 \\ 0 && c_1 && - s_1 \\ 0 && s_1 && c_1 \end{bmatrix}\begin{bmatrix} c_2 && 0 && s_2 \\ 0 && 1 && 0 \\ -s_2 && 0 && c_2 \end{bmatrix} \begin{bmatrix} c_3 && -s_3 && 0 \\ s_3 && c_3 && 0 \\ 0 && 0 && 1 \end{bmatrix}$$

And this reduces to

$$R_x R_y R_z = \begin{bmatrix} c_2 c_3 && - c_2 s_3 && s_2 \\ s_1 s_2 c_3 + c_1 s_3 && - s_1 s_2 s_3 + c_1 c_3 && - s_1 c_2 \\ - c_1 s_2 c_3 + s_1 s_3 && c_1 s_2 s_3 + s_1 c_3 && c_1 c_2 \end{bmatrix}$$

And this is to equal a given rotation matrix $$R$$ given by

$$R = \begin{bmatrix} R_{11} && R_{12} && R_{13} \\ R_{21} && R_{22} && R_{23} \\ R_{31} && R_{32} && R_{33} \end{bmatrix}$$

Comparing the third column in both matrices, we deduce that

$$s_2 = \sin \theta_2 = R_{13}$$

So that $$\theta_2 = \sin^{-1}(R_{13})$$ or $$\theta_2 = \pi - \sin^{-1}(R_{13} )$$

From the second and third components of the third column in each matrix, we deduce that corresponding to each of the two possible values of $$\theta_2$$ we have

$$\theta_1 = \text{atan2} \left( \dfrac{ R_{33} }{c_2} , -\dfrac{ R_{23} }{c_2} \right)$$

And from the first row in each matrix, we have

$$\theta_3 = \text{atan2} \left( \dfrac{R_{11}}{ c_2 } , - \dfrac{R_{12}}{c_2} \right)$$

Therefore, for each rotation matrix $$\in SO(3)$$, we can find two factorizations $$R_x(\theta_1) R_y(\theta_2) R_z(\theta_3)$$ for it.