Great arc distance between two points on a unit sphere
Consider the two vectors to the points on the sphere, $${\bf v}_i=(r\sin\theta_i\cos\varphi_i,r\sin\theta_i\sin\varphi_i,r\cos\theta_i)$$ with $i=1,2$. Use the dot product to get the angle $\psi$ between them: $${\bf v}_1\cdot {\bf v}_2=r^2\left(\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2\cos\left(\varphi_1-\varphi_2\right)\right)=r^2\cos\psi.$$
Then the arclength is $$s=r\psi=r\cos^{-1}\left(\cos\theta_1\cos\theta_2+\sin\theta_1\sin\theta_2\cos\left(\varphi_1-\varphi_2\right)\right).$$