I have a unit sphere with points on its surface described by their azimuth and elevation. Azimuth is given as a number in $[0, 2 \pi]$, while elevation is a between $[-\pi/2, \pi/2]$.
I would like to rotate the sphere on the elevation axis (rotating by azimuth is trivial). For example, I'd rotate the sphere by $\pi / 2$ at azimuth 0, meaning that any point at azimuth 0 will be "elevated" by $\pi / 2$, while points on other azimuths will be elevated by a different amount depending on how far they are from the pivot point.
On the other side of the azimuth, at $\pi$, each point would be pushed down by $\pi / 2$.
What I'm after is the transformation formula for any point on the surface, for a given elevation angle and azimuth pivot point.
I'm having trouble working out the math for this. I have a version but I get false results. I'd really appreciate some help.
It is very easy to compute this rotation in a 3D cartesian coordinate system on the 2-sphere $\Bbb S^2$, simply by applying a certain rotation matrix. But it is tricky to do this in your azimuth/elevation system on $[0,2\pi]\times[-\pi/2,\pi/2]$.
I therefore recommend convert between these systems. How this can be done in detail is well-explained on the Wikipedia article on sphereical coordinate systems.
So I assume we have
I assume that $f(0,0)=(1,0,0)$ is mapped to the positive $x$-axis, and $f(\pi/2,0)=(0,1,0)$ is mapped to the positive $y$-axis. This means that elevation describes the rotation out of the $xy$-plane.
Now, let's say you want to rotatate around elevation by an angle of $\Delta\theta$ at azimuth $\phi_0$. This can be done by the following transformation:
$$h_{\phi_0}\circ g\circ R_{\Delta\theta}\circ f\circ h_{-\phi_0}\quad:\quad (\phi,\theta)\quad\mapsto\quad h_{\phi_0}(g(R_{\Delta\theta}f(h_{-\phi_0}(\phi,\theta)))).$$
It is not a nice formula, but it works. One might write this out as a single formula, but it will probably be long and ugly.