The spherical distance, also called the great-circle distance, between two points and
on a sphere is the distance
of the shortest path along the surface
of the sphere (paths that cut
through the interior of the sphere
are not allowed) from
to
, which always lies along a great circle.
For points and
on the unit sphere centered
at the origin, the spherical distance is given by
|
(1)
|
where
denotes a dot product and
denotes the principal
value of the inverse cosine (Brannan et
al. 1999, p. 344).
For points given by longitudes and latitudes
, let
and set
|
(2)
| |||
|
(3)
|
Then
and
. The distance is twice the angle of the
planar vector
measured from the positive horizontal axis. This form is equivalent to Kahan's tangent-half-angle
formula (2006, p. 44) where its tangents are finite. Computing
and
separately avoids subtracting nearly equal values to recover
a small half-angle sine or cosine. For Cartesian input, the spherical distance on
the unit sphere is the vector angle between
and
. For a sphere of radius
, multiply the central angle by
.