MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a Computer Science undergraduate who does a lot of other tinkering in his free time. Right now, I'm tinkering with n-spheres. Specifically, I'm looking at the distances between a collection of points on n-sphere surfaces. Euclidean distances are trivial (but in this particular application still interesting). I would like to look at "great-circle" distances between points on an n-sphere, but unfortunately I am not familiar with Riemannian Geometry or anything of the sort.

How can one go about calculating the distance between two points on an n-sphere? Can you make this digestible for an undergraduate student who is unfamiliar with the literature?

share|cite|improve this question
up vote 6 down vote accepted

The two-dimensional formula applies (why?): the great-circle distance is $\cos^{-1}(\vec u\cdot \vec v)$ where $\vec u$ and $\vec v$ are position vectors of the points.

share|cite|improve this answer
To add to Kovalev's response, given two points on the n-sphere, generically they span a plane (unless the points are antipodal and the distance is $\pi$, or identical and the distance is $0$). In a plane the distance is given by Kovalev's formula, and that's the proof. – Ryan Budney Jan 1 '10 at 3:14
Just in case it matters, the above is assuming a sphere of radius 1. Multiply the answer by the radius to adjust for different sized spheres. – Jason DeVito Jan 1 '10 at 4:44
Brilliant. Googling didn't give me a generalized equation. Thank you MO and thank you Kovalev, Budney and DeVito. – Ross Snider Jan 1 '10 at 5:23
Can I have the same formula in spherical coordinates? Thanks! – F.Cuevas Feb 8 at 13:49
@F. Cuevas: convert it to rectangular coordinates (that formula is not hard) and apply the formula above. – Willie Wong Feb 8 at 19:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.