We can write the relationship between planar coordinates \(X\) and \(Y\) , and spherical coordinates \(\theta\) and \(\phi\) as
\(X = \kappa\sin{\theta}\sin{(\phi-\phi_0)}\)
\(Y = \kappa(\sin{\theta_0}\cos{\theta}-\cos{\theta_0}\sin{\theta}\cos{(\phi-\phi_0)})\)
where \(\kappa=\frac{2}{1+\cos{\theta_0}\cos{\theta}+\sin{\theta_0}\sin{\theta}\cos{(\phi-\phi_0)}}\)
If we insert \(\kappa\) we can rewrite X and Y as:
Our start position is where X=Y=0, meaning that \(\theta_0 = \frac{\pi}{2}\) and \(\phi_0 = 0\).
We start by finding an expression for X when Y=0. At this point, we are rotating around the equator, meaning that \(\theta=\theta_0=\frac{\pi}{2}\). If we insert our values into the expression for X above, we get:
We can make a similar argument for Y, when X=0. At this point we have that \(\phi=\phi_0=0\). Again we insert our known values and get a new expression for Y:
Because \(\theta\) and \(\phi\) are both limited by our field of fiew, which we will write as \(\alpha\), X and Y must also be limited.
\(\alpha_{\theta}=\theta_{max}-\theta_{min}\) and \(\alpha_{\phi}=\phi_{max}-\phi_{min}\)
In our case our field of view is 70°, which is what we will use when implementing the transformation, but the general expression for the case when we are moving around the equator is:
Which is the expression we use when converting from our spherical coordinates to planar coordinates!