# Great-circle distance

The great-circle distance is the shortest distance between any two points on the surface of a sphere measured along a path on the surface of the sphere (as opposed to going through the sphere's interior). Because spherical geometry is rather different from ordinary Euclidean geometry, the equations for distance take on a different form. The distance between two points in Euclidean space is the length of a straight line from one point to the other. On the sphere, however, there are no straight lines. In non-Euclidean geometry, straight lines are replaced with geodesics. Geodesics on the sphere are the great circles (circles on the sphere whose centers are coincident with the center of the sphere).

Between any two points on a sphere which are not directly opposite each other, there is a unique great circle. The two points separate the great circle into two arcs. The length of the shorter arc is the great-circle distance between the points. Between two points which are directly opposite each other, called antipodal points, there are infinitely many great circles, but all great circle arcs between antipodal points have the same length, i.e. half the circumference of the circle, or , where r is the radius of the sphere.

Because the Earth is approximately spherical (see spherical Earth), the equations for great-circle distance are important for finding the shortest distance between points on the surface of the Earth, and so have important applications in navigation.

## The geographical formula

Let be the geographical latitude and longitude of two points (a base "standpoint" and the destination "forepoint"), respectively, the longitude difference and the (spherical) angular difference/distance, or central angle, which can be constituted from the spherical law of cosines:

This arccosine form can have large rounding errors for the common case where the distance is small, however, so it is not normally used. Instead, a simpler equation known historically as the haversine formula was preferred, which is much more accurate for small distances:[1]

(Historically, the use of this formula was simplified by the availability of tables for the haversine function: hav(θ) = sin2(θ/2).)

Although this formula is accurate for most distances, it too suffers from rounding errors for the special (and somewhat unusual) case of antipodal points (on opposite ends of the sphere). A more complicated formula that is accurate for all distances is:

(When programming a computer, one should use the atan2() function rather than the ordinary arctangent function (atan()), in order to simplify handling of the case where the denominator is zero.)

If r is the great-circle radius of the sphere, then the great-circle distance is .

Note: above, accuracy refers to rounding errors only; all formulas themselves are exact (for a sphere).

## Spherical distance on the Earth

The shape of the Earth more closely resembles a flattened spheroid with extreme values for the radius of arc, or arcradius, of 6335.437 km at the equator (vertically) and 6399.592 km at the poles, and having an of 6372.795 km (3438.461 nautical miles).

Using a sphere with a radius of 6372.795 km thus results in an error of up to about 0.5%.

## A worked example

In order to use this formula for anything practical you will need two sets of coordinates. For example, the latitude and longitude of two airports:
• Nashville International Airport (BNA) in Nashville, TN, USA: N 36Â°7.2', W 86Â°40.2'
• Los Angeles International Airport (LAX) in Los Angeles, CA, USA: N 33Â°56.4', W 118Â°24.0'
First, convert these coordinates to decimal degrees (Sign × (Deg + (Min + Sec / 60) / 60)) and radians (Ã— π / 180) before you can use them effectively in a formula. After conversion, the coordinates become:
• BNA:
• LAX:
Using these values in the angular difference/distance equation:

:

Thus the distance between LAX and BNA is about 2887 km or 1794 miles (Ã— 0.62137) or 1558 nautical miles (Ã— 0.539553).

## Spherical coordinates

In the spherical coordinates used by mathematicians and physicists, usually when considering other spheres than the Earth's surface, the great-circle distance is found as follows. If is the azimuthal angle and the colatitude, then the spherical distance is given by

Note that if then and the distance formula reduces to

The notation above is that used in the physical sciences. Pure mathematicians, by contrast, conventionally interchange the roles of the letters and .

## References

1. ^ R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159

* Distance calculator
Distance is a numerical description of how far apart objects are at any given moment in time. In physics or everyday discussion, distance may refer to a physical length, a period of time, or an estimation based on other criteria (e.g. "two counties over").
A spatial point is a concept used to define an exact location in space. It has no volume, area or length, making it a zero dimensional object. Points are used in the basic language of geometry, physics, vector graphics (both 2D and 3D), and many other fields.
A sphere is a symmetrical geometrical object. In non-mathematical usage, the term is used to refer either to a round ball or to its two-dimensional surface. In mathematics, a sphere is the set of all points in three-dimensional space (R3
Spherical geometry is the geometry of the two-dimensional surface of a sphere. It is an example of a non-Euclidean geometry. Two practical applications of the principles of spherical geometry are navigation and astronomy.
Euclidean geometry is a mathematical system attributed to the Greek mathematician Euclid of Alexandria. Euclid's text Elements is the earliest known systematic discussion of geometry.

An essential property of a Euclidean space is its flatness. Other spaces exist in geometry that are not Euclidean.
non-Euclidean geometry describes hyperbolic and elliptic geometry, which are contrasted with Euclidean geometry. The essential difference between Euclidean and non-Euclidean geometry is the nature of parallel lines.
In mathematics, a geodesic is a generalization of the notion of a "straight line" to "curved spaces". In presence of a metric, geodesics are defined to be (locally) the shortest path between points on the space.
In mathematics, a geodesic is a generalization of the notion of a "straight line" to "curved spaces". In presence of a metric, geodesics are defined to be (locally) the shortest path between points on the space.
• Great circle is a circle on the surface of a sphere.
• Great Circle is also a fictional organization from Andromeda Nebula, a novel by Ivan Yefremov

A great circle

The circumference is the distance around a closed curve. Circumference is a kind of perimeter.

## Circle

The circumference of a circle can be calculated from its diameter using the formula:

In classical geometry, a radius (plural: radii) of a circle or sphere is any line segment from its center to its perimeter. By extension, the radius of a circle or sphere is the length of any such segment. The radius is half the diameter.
A sphere is a symmetrical geometrical object. In non-mathematical usage, the term is used to refer either to a round ball or to its two-dimensional surface. In mathematics, a sphere is the set of all points in three-dimensional space (R3
spherical Earth was espoused by Pythagoras apparently on aesthetic grounds, as he also held all other celestial bodies to be spherical. It replaced earlier beliefs in a flat Earth: In early Mesopotamian thought, the world was portrayed as a flat disk floating in the ocean, and this
Navigation is the process of planning, recording, and controlling the movement of a craft or vehicle from one place to another.[1] The word navigate is derived from the Latin roots navis meaning "ship" and agere meaning "to move" or "to direct.
equator divides the planet into a Northern Hemisphere and a Southern Hemisphere, and has a latitude of 0. Latitude, usually denoted symbolically by the Greek letter phi, , gives the location of a place on Earth north or south of the equator.
equator divides the planet into a Northern Hemisphere and a Southern Hemisphere, and has a latitude of 0. Longitude is the east-west geographic coordinate measurement most commonly utilized in cartography and global navigation.
A central angle is an angle whose vertex is the center of a circle, and whose sides pass through a pair of points on the circle, thereby subtending an arc between those two points whose angle is (by definition) equal to the central angle itself.
In spherical trigonometry, the law of cosines (also called the cosine rule for sides) is a theorem relating the sides and angles of spherical triangles, analogous to the ordinary law of cosines from plane trigonometry.
A round-off error, also called rounding error, is the difference between the calculated approximation of a number and its exact mathematical value. Numerical analysis specifically tries to estimate this error when using approximation equations and/or algorithms, especially
The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines
The versed sine, also called the versine and, in Latin, the sinus versus ("flipped sine") or the sagitta ("arrow"), is a trigonometric function versin(θ) (sometimes further abbreviated "vers") defined by the equation:

atan2 is a two-argument function that computes the arctangent of given y and x, but with a range of . It was introduced first in many computer programming languages but is now common in all fields of science and engineering too.