Combining two rotations

3drotations

I'm working on a project, where I have to perform rotations of a point which is on the surface of a sphere of radius 1, around the center of the sphere.

In order to do so, I have a function, let's call it $U$, that is parametrized by 3 angles (real numbers) $\theta$, $\phi$ and $\lambda$, and that performs the following operations on its input: it performs a rotation on $z$ of $\phi$ radians, then a rotation over $y$ of $\theta$ radians, and finally a last rotation, again on $z$, of $\lambda$ radians.

In short: $U(\theta, \phi, \lambda) := R_z(\phi) R_y(\theta) R_z(\lambda)$.

Now here is my question: if I successively apply U with angles $\theta_1, \phi_1, \lambda_1$, and then with other angles $\theta_2, \phi_2, \lambda_2$, is there a method to find which angles $\theta, \phi, \lambda$ would have led to the same rotation in only one application of the function, and if so, how ?

Best Answer

You can express rotations as matrices. Their combination is found by matrix multiplication.

In your case

it performs a rotation on $z$ of $\phi$ radians, then a rotation over $y$ of $\theta$ radians, and finally a last rotation, again on $z$, of $\lambda$ radians.

we have:

\begin{align} U &= R_z(\lambda) \, R_y(\theta) \, R_z(\phi) \\ &= \begin{pmatrix} \cos\lambda & -\sin\lambda & 0 \\ \sin\lambda & \cos\lambda & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} \cos\theta & 0 & -\sin\theta \\ 0 & 1 & 0 \\ \sin\theta & 0 & \cos\theta \end{pmatrix} \begin{pmatrix} \cos\phi & -\sin\phi & 0 \\ \sin\phi & \cos\phi & 0 \\ 0 & 0 & 1 \end{pmatrix} \\ &= \begin{pmatrix} \cos\lambda & -\sin\lambda & 0 \\ \sin\lambda & \cos\lambda & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} \cos\theta \cos\phi & -\cos\theta \sin\phi & -\sin\theta \\ \sin\phi & \cos\phi & 0 \\ \sin\theta \cos\phi & -\sin\theta \sin\phi & \cos\theta \end{pmatrix} \\ &= \begin{pmatrix} \cos\lambda \cos\theta \cos\phi - \sin\lambda \sin\phi & -\cos\lambda \cos\theta \sin\phi - \sin\lambda \cos\phi & -\cos\lambda \sin\theta \\ \sin\lambda \cos\theta \cos\phi + \cos\lambda \sin\phi & -\sin\lambda \cos\theta \sin\phi + \cos\lambda \cos\phi & -\sin\lambda \sin\theta \\ \sin\theta \cos\phi & -\sin\theta \sin\phi & \cos\theta \end{pmatrix} \end{align} This results in a single $3 \times 3$ matrix.

If you have two of those transformations $U_1$ and $U_2$ then the composition is given by the matrix product $$ U_2 U_1 $$ One would have to calculate the resulting matrices and then check if it is possible to easily read the angles from the result.

Related Question