How to traverse surface of sphere with two degrees of freedom?

125 Views Asked by At

Is there a generic means of expressing the movement along the surface of a sphere with two degrees of freedom that doesn't have to deal with special cases?

For example, consider a unit sphere centered at the origin. Most points can be rotated (moved along the sphere) by first rotating about the z axis (heading) followed by rotation about the y axis (pitch). However, this has the special case that must be dwelt with -- the points at the poles that lie on the z axis.

(edit) To be specific, let's define movement along the sphere with two angles defined by these rotation matrices:

$$ \begin{bmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix} \begin{bmatrix} \cos\phi & -\sin\phi & 0 \\ \sin\phi & \cos\phi & 0 \\ 0 & 0 & 1 \end{bmatrix} $$

If I try to rotate the vector $[0, 0, 1]^T$, $\phi$ does nothing and I can only move to points along the $xz$ plane.

Is there a more generic 2-DOF representation of the traversal of the surface of a sphere?