Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a $3$-D sphere of radius $R$, centered at the origin.

$(x_1,y_1,z_1)$ and
$(x_2,y_2,z_2)$ are two points on the sphere.

The Euclidean distance is easy to calculate, but what if I were to restrict myself to traveling on the surface of the sphere?

Two approaches come to mind: use arc-length in some way, or simply use trigonometry: calculate the angle between the two points and get a distance from that.

Will both/either of these methods work? Which would be easier?

Somewhat related to this question. Maybe it will inspire someone to go answer it!

share|improve this question
1  
Just got out of my great-circle distance class, etc. –  Larry Wang Jul 27 '10 at 1:09
    
This is my answer on a somewhat related question--there, the question was finding angles (which is not entirely unrelated), but the bigger difference is that the points are described by latitude and longitude. The Spherical Law of Cosines and the diagrams there may be helpful. –  Isaac Aug 2 '10 at 4:33

3 Answers 3

up vote 11 down vote accepted

What you are looking for is what is called the great circle distance: the shortest curve connecting two points on the surface of a sphere is given by traveling along the (there will be exactly one unless the points are polar opposites) arc of the great circle (that is, the circle of radius $R$) connecting them.

So, you do need to find an arc length but it is easy to do this without invoking calculus if you know about the dot product. Suppose the two points on the circle are represented by the vectors $v$ and $w$. If $v\cdot w$ denotes the dot product of these two vectors, then the angle between them will be:

$\cos^{-1}\left(\large\frac{v\cdot w}{R^2}\right)$ (we divide by $R^2$ since $v$ and $w$ have length $R$).

Assuming this is in radians, to get the length of the arc connecting them we just multiply this angle by $R$ to get:

$R\cos^{-1}\left(\large\frac{v\cdot w}{R^2}\right)$.

We are quite lucky that there is such a simple formula. For most manifolds, the curves that minimize distances are not very easy to find since it involves solving a non-linear differential equation (the geodesic equation). The fact that the sphere is so symmetric helps in this case, and you can maybe convince yourself that an arc of a great circle minimizes distance.

You may find this wikipedia article interesting: http://en.wikipedia.org/wiki/Geodesic.

share|improve this answer

Here is an online calculator for great circle distance and here is a detailed explanation of the calculations behind it.

share|improve this answer

If you have the Euclidean distance d between the two points, and set D = the diameter of the sphere (so D = 2R), then the great circle distance is D*InvSin(d/D), where InvSin is the inverse sine function. If you know that d/D is usually very small, then you can approximate the great circle distance using a few terms of the Taylor series for inverse sine.

share|improve this answer

Your Answer

 
discard

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.