Great-Circle Distance Calculator
Enter two points in decimal degrees (south and west negative) to get the great-circle distance, the bearings along the route and its midpoint.
Distance
343.56 km
Distance
213.48 mi
Distance
185.51 nmi
Central angle
3.0897°
Initial bearing
148.12°
Final bearing
150.02°
Midpoint latitude
50.1886°
Midpoint longitude
1.1466°
How it works
The shortest path between two points on a sphere is an arc of the great circle through them, the circle whose centre is the centre of the sphere. Its length is the sphere's radius times the central angle between the two points. The haversine formula computes that angle from the two latitudes and the difference in longitude in a way that stays accurate for points very close together, where the older spherical law of cosines loses precision.
The Earth is modelled as a sphere of radius 6371.0088 km, the IUGG mean radius of the GRS80 ellipsoid. Real distances along the ellipsoid differ by typically under 0.3%, up to about 0.5–0.6% (worst on north–south routes near the equator); for air routes, shipping and most planning that is close enough. The result is given in kilometres, statute miles and international nautical miles (1852 m).
A great-circle route does not hold a constant compass heading. The initial bearing is the direction to set out on from point 1; the final bearing is the direction of travel on arrival at point 2, which on a long route can differ by tens of degrees. The midpoint is the point halfway along the arc, not the average of the coordinates.
Formula
a = sin²(Δφ ÷ 2) + cos φ₁ · cos φ₂ · sin²(Δλ ÷ 2) c = 2 · atan2(√a, √(1 − a)) (central angle, radians) d = R · c (R = 6371.0088 km) initial bearing θ₁ = atan2(sin Δλ · cos φ₂, cos φ₁ · sin φ₂ − sin φ₁ · cos φ₂ · cos Δλ) final bearing θ₂ = (bearing from point 2 back to point 1) + 180° midpoint: Bx = cos φ₂ cos Δλ, By = cos φ₂ sin Δλ, φm = atan2(sin φ₁ + sin φ₂, √((cos φ₁ + Bx)² + By²)), λm = λ₁ + atan2(By, cos φ₁ + Bx)
Example
London (51.5074°, −0.1278°) to Paris (48.8566°, 2.3522°): Δφ = −2.6508°, Δλ = 2.48°, a ≈ 0.000727, c ≈ 0.05392 rad = 3.0897°, so d = 6371.0088 × 0.05392 ≈ 343.56 km, or 213.48 mi and 185.51 nmi. The initial bearing is 148.12° (south-east), the final bearing 150.02°, and the midpoint is at 50.1886°, 1.1466°.
From the equator at 0° longitude to the equator at 180°, the two points are antipodal: the central angle is 180° and the distance is half the circumference, π × 6371.0088 ≈ 20,015.11 km.
Assumptions and limitations
- Spherical Earth of radius 6371.0088 km (IUGG mean radius). Distances on the WGS84 ellipsoid differ by typically under 0.3%, up to about 0.5–0.6% (worst on north–south routes near the equator), and distances over the ground also ignore terrain and altitude.
- Coordinates are decimal degrees with north and east positive. Convert degrees-minutes-seconds first: 51°30′26″ N is 51 + 30/60 + 26/3600 = 51.5072°.
- Antipodal points (exactly opposite each other) have infinitely many shortest routes; the bearings and midpoint shown are for one of them.
- Bearings are true bearings relative to geographic north, not magnetic.
- 1 nautical mile = 1852 m exactly; 1 statute mile = 1609.344 m exactly.
Frequently asked questions
Why do the initial and final bearings differ?
A great circle crosses the meridians at changing angles because the meridians converge towards the poles. Only routes along the equator or along a meridian keep a constant bearing. A route that does hold one heading is a rhumb line, which is longer.
How accurate is the haversine formula?
On a perfect sphere it is exact and numerically stable down to a few metres apart. The approximation is in using a sphere for the Earth, which introduces an error against the ellipsoid of typically under 0.3%, up to about 0.5–0.6% (worst on north–south routes near the equator); Vincenty's formulae remove that if you need it.
More in Math & Geometry calculators.