# Generalized Great Circle Distance

I am interested in applying the great circle distance formula to points on an n-sphere, and I would like to know how to generalize the spherical law of cosines to an n-sphere so that I can obtain the central angle.

• Wouldn't you just use the law of cosines to find the angle then $s=r\theta$? Jan 12, 2017 at 3:51
• @JohnWaylandBales Yes, I should have been more specific. I would like to generalize the law of cosines to n dimensions, then use s=rθ to calculate the great circle distance. I guess my real question is how to generalize the law of cosines when working in n dimensions. I'll update the question. Jan 12, 2017 at 16:46
• The law of cosines is the same in any dimension $n>1$ since the angle between two vectors always lies in the planar span of the two vectors. The formula which you give is for finding the distance in terms of latitude and longitude. To find a similar formula for an $n$-sphere you would have to use analogous notions of latitude and longitude for the $n$-sphere. How do you generalize latitude and longitude for the $n$-sphere? Jan 12, 2017 at 17:19
• @Tara: If $u$ and $v$ are unit vectors in $\mathbf{R}^{n}$, the spherical distance between $u$ and $v$ (viewed as points on the unit sphere) is $\arccos(u \cdot v)$. Jan 12, 2017 at 17:49
• @AndrewD.Hwang Yes, the arccos(u⋅v) formula is a much simpler way of looking at the problem than using latitude and longitude, which I'm pretty sure would involve n-2 "central" angle calculations. Thanks for pointing this out! Jan 12, 2017 at 18:39