# 3D rotational matrix between two spherical co-ordinate systems.

So I have a classical mechanics problem where I have worked out the azimuthal and altitude angle for a vector, I then want to apply rotational matrices so that the vector is realigned with the z axis only. i.e. I want to turn a spherical co-ordinate (r, $\theta$,$\phi$) into Euler rotations

To do this I think I need to do

\begin{alignat}{1} R_z(\phi) &= \begin{bmatrix} \cos \phi & -\sin \phi & 0 \\[3pt] \sin \phi & \cos \phi & 0\\[3pt] 0 & 0 & 1\\ \end{bmatrix}\\[6pt] then\\ R_y(\theta) &= \begin{bmatrix} \cos \theta & 0 & \sin \theta \\[3pt] 0 & 1 & 0 \\[3pt] -\sin \theta & 0 & \cos \theta \\ \end{bmatrix} \\[6pt] then\\ R(\psi) &= \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \psi & -\sin \psi \\[3pt] 0 & \sin \psi & \cos \psi \\[3pt] \end{bmatrix} \\[6pt] \end{alignat}

But I don't know how to work out $\psi$ for this as the first rotation is about the z axis and so rotates the x and y axis, and then the second matrix only rotates around the y axis, but the angle $\theta$ in spherical co-ordinates is not about the y axis only but x and y at the same time depending on the angle $\phi$.

Any suggestions?

• You're probably having problems because any single vector can be rotated to another vector in terms of one rotation, or even just two rotations about Cartesian axes. I think to decompose into three rotations, your problem is underdetermined. – Muphrid Dec 4 '14 at 16:21
• Yes I agree, but I don't know which two matrices will work. – Pigeon Dec 4 '14 at 19:20

## 1 Answer

If I start with a vector in the z direction

\begin{alignat}{1} V &=|V| \begin{bmatrix} 0 \\[3pt] 0\\[3pt] 1\\ \end{bmatrix}\\[6pt] \end{alignat}

then $R_z(\phi)R_y(\theta)V$

I get \begin{alignat}{1} V_{new} &=|V| \begin{bmatrix} \sin\theta\cos\phi \\[3pt] \sin\theta\sin\phi\\[3pt] \cos\theta\\ \end{bmatrix}\\[6pt] \end{alignat}

Which happens to be the right form for the spherical co-ordinate. Can anyone see why this would be wrong in general?

• Indeed, in the physics convention a latitude rotation will take you to the proper parallel (latitude) and a longitude rotation will subsequently take you to the desired meridian. You may reverse these rotations on fixed axes to go back to the North pole. – Cosmas Zachos Feb 3 '18 at 21:59