CACTUSPEAR.ORG PRESENTS

distance between two points
on the surface of a sphere

To find the length of the arc along the "great circle" that passes through two points on a sphere. A great circle is one whose radius is equal to the radius of the sphere, and whose center coincides with the center of the sphere.

Note: Another way to define a great circle is the intersection of the sphere with a plane that passes through its center.

Note: Given two points on a sphere, we're guaranteed that there is only one great circle containing them, as the two points along with the center of the sphere uniquely determine the plane that contains the circle.

Let O(0, 0, 0) be the center of the sphere, and let P(x1, y1, z1) and Q(x2, y2, z2) be points on the sphere.

Consider the vectors OP = <x1, y1, z1> and OQ = <x2, y2, z2>. We wish to determine the angle θ between these two vectors.

By the definition of the dot product,

OP · OQ = ‖OP‖‖OQ‖ cos θ, where the double vertical lines denote the length of a vector.

or, cos θ = OP · OQ / ‖OP‖‖OQ

= (x1x2 + y1y2 + z1z2)/r2

θ = arc cos [(x1x2 + y1y2 + z1z2)/r2]

Finally, the ratio of the length of the arc PQ to the circumference of the circle it lies on is equal to the ratio of θ to the number of radians in a circle.

That is, PQ/2πr = θ/2π, or PQ = rθ.

PQ = r arc cos [(x1x2 + y1y2 + z1z2)/r2]

§ § §

When referring to points on the earth's surface, however, we usually don't use Cartesian coordinates. It's more common to use longitude and latitude.

To pose a simplified question, what's the distance between two points on the equator (0° latitude)? Let their angular displacement from the Prime Meridian be λ1 and λ2 degrees.

Note: By convention, −180° (westward) ≤ λi ≤ 180° (eastward) for all longitudes λi.

Let λ be the angle between the two vectors. Then

λ = |λ1 − λ2| for all |λ1 − λ2| ≤ 180, and

λ = 360 − |λ1 − λ2| for all |λ1 − λ2| > 180.

Note: If λ is greater than 180 (a reflex angle), then we take its explement or conjugate.

Therefore, the distance along the earth's surface between the latitudes λ1 and λ2 is rλ, where r is the radius of the earth.

Note: If a closed expression for λ is required, we can use the somewhat ungainly formulation:

λ = || 180 − |λ1 − λ2|| − 180 |.

§ § §

We may make a similar statement about two points on the Prime Meridian (0° longitude). Let their angular displacement from the Equator be φ1 and φ2.

Note: By convention, (South Pole) −90° ≤ φi ≤ 90° (North Pole) for all latitudes φi.

Let φ be the angle between the two vectors. Then

φ = |φ1 − φ2| for all φ1, φ2

Therefore, the distance along the earth's surface between the longitudes φ1 and φ2 is rφ, where r is the radius of the earth.


CACTUS PEAR HOME
comments to comments at cactuspear dot org