# Angle between two 'small circles' on the surface of a sphere

This seems like it should be fairly simple, but it has me completely stumped. Imagine I have a latitude line at angle $\theta_1$ on the surface of the unit sphere in 3D. This is a "small circle", meaning it's a circle that's not a great circle. Now suppose I have, in addition, a second coordinate system where the axis is at an angle $\phi$ to the original axis, and a second latitude line at an angle $\theta_2$ in the new coordinate system: If these two curves cross, they do so at two points. I want to know the angle they make on the surface of the sphere. That is, the angle between the vectors tangent to the two circles at a point where they cross: What is this angle $\psi$, as a function of $\phi$, $\theta_1$ and $\theta_2$?

The answer is simple once you see the spherical geometry of the situation. Suppose you have a point $P$ on the sphere. There are two other points $P_1,P_2$ each at fixed angular distances $\Theta_1,\Theta_2$ from $P$. The two "latitude" angles $\theta_1,\theta_2$ are the respective complementary angles. The two points $P_1,P_2$ are at an angular distance $\phi$ from each other. The three points $P,P_1,P_2$ form a spherical triangle. Now the small circle centered at $P_1$ and passing through $P$ has a tangent line on the sphere surface which is perpendicular to the great circle determined by $P,P_1$ which forms one side of the spherical triangle. Similarly with the small circle centered a $P_2$. Thus, the angle $\psi$ between the two tangent lines is the same as the angle at $P$ of the spherical triangle. This angle can be found using the spherical law of cosines since the angular distance between the three points $P,P_1,P_2$ are known. The cosine law states $$\cos \phi = \cos \Theta_1 \cos \Theta_2 + \sin \Theta_1 \sin \Theta_2 \cos \psi$$ and since $\Theta_1,\Theta_2$ are complementary to $\theta_1,\theta_2$ we get $$\cos \psi = (\cos \phi - \sin \theta_1 \sin \theta_2 ) / (\cos \theta_1 \cos \theta_2).$$