# Spherical Distance between Two Points

A great circle is a circle obtained by intersecting a sphere with a plane through the sphere's center. The radius of a great circle is equal to the radius of the sphere. So it has the largest value possible for the radius of a circle on the surface of the sphere. The shortest distance of two points on the surface is always part of a great circle.

In the drawing, the sphere is shown with some circles of longitude and latitude (parallel projection). In addition, the given points and the great-circle arc between them are highlighted (in red).

In the first line of the control panel radii from 1 000 km to 1 000 000 km can be inserted (don't forget the enter key!), whereby the earth radius is preset. Further input and selection fields allow the definition of two points on the surface of the sphere. The distance calculated from this information is displayed as an angle (in degrees) and as length (in km). By using the five small buttons, you can vary the direction of projection.

This browser doesn't support HTML5 canvas!

The following expression for the searched distance results from the cosine rule of the spherical trigonometry:

d  =  r · arccos (sin φA sin φB + cos φA cos φB cos (λB - λA))

r .... radius of the sphere
λA ... geographic longitude of point A
φA ... geographic latitude of point A
λB ... geographic longitude of point B
φB ... geographic latitude of point B

Practical hint for recalculation: The function arccos appearing here is the inverse function of the cosine function, usually denoted cos−1 on pocket calculators. If you use the calculator with the setting for degrees (usually DEG), you must be aware that the arccos value is displayed in degrees. Only after you have converted the degrees into radians, you may multiply with the radius of the sphere.