Great-Circle Distance Calculator
The great-circle distance is the length of the shortest path between two points on a sphere: the arc of the great circle that joins them. It is the route flown by long-haul aircraft. Enter the coordinates of the two points (latitude, longitude) and the radius of the sphere.
Convention: latitude positive towards the north, longitude positive towards the east. The mean radius of the Earth is about 6,371 km.
Coordinates and radius
Result
- Great-circle distance 5,837 km
- Initial bearing 291.8 °
| Central angle (great-circle arc) | 52.4956 ° |
| Distance | 5,837 km (5,837.2 km) |
| Initial bearing (from north) | 291.8 ° |
d = R · Δσ, Δσ = 2·arcsin(√( sin²(Δφ/2) + cos φ₁·cos φ₂·sin²(Δλ/2) ))
Asterisks in the text link to the glossary.
Great circles as shortest paths
Two points on a sphere, plus the centre, determine a plane. That plane cuts the sphere in a great circle*: a circle whose radius is the sphere’s radius, the largest circle that fits. Between the two points the circle offers two arcs. The shorter one is the great-circle track, historically the orthodrome*.
Its length is R times the central angle Δσ, with Δσ in radians. That is the whole definition. All the trigonometry on this page exists to obtain Δσ from latitudes and longitudes.
d = R · Δσ
Every meridian is a great circle. So is the equator. A parallel of latitude is not, except the equator: its radius is R cos φ, smaller, so it is a longer path between two longitudes than the bulge toward the pole. Following 45° N from Bordeaux to the Black Sea is longer than cutting a little north. That is the whole reason polar routes exist.
The haversine formula and numerical stability
The spherical law of cosines writes cos Δσ = sin φ₁ sin φ₂ + cos φ₁ cos φ₂ cos Δλ. It is exact. In floating point, for two nearby points, cos Δσ ≈ 1, and arccos loses digits — the same kind of cancellation that spoils a badly conditioned quadratic. The haversine* formula steps around that.
hav(θ) = sin²(θ/2)
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
Δσ = 2 · atan2(√a, √(1 − a))
sin(Δφ/2) stays honest when Δφ is small. atan2 of the pair (√a, √(1 − a)) stays honest as well. This page uses exactly that. On a transatlantic leg, cosine and haversine agree to the kilometre. On two lamp-posts in a car park, only haversine remains readable. Inverse haversine via atan2 also behaves at antipodes, where a ≈ 1.
The quadratic solver has the same numerical moral: the textbook formula is algebraically right and can be the wrong thing to type into a machine.
Initial bearing: a heading that changes along the route
A great-circle track is not a constant-heading course, except on a meridian or on the equator. The azimuth — from north, clockwise — slides along the path. What the form prints is the initial bearing: the heading at departure, the number a flight-management system would use to leave the runway, not the number at touchdown.
θ = atan2( sin Δλ · cos φ₂ , cos φ₁ · sin φ₂ − sin φ₁ · cos φ₂ · cos Δλ )
On a westbound North Atlantic crossing the initial heading is north of west, then the heading eases toward the west and finally south of west as the track comes down the far side of the polar bulge. That is not a steering error. It is the geometry of a straight line on a sphere, written in a compass that always points to a pole.
Arrival bearing is the initial bearing of the reverse leg, plus 180°, wrapped into [0, 360). The two are not 180° apart on an east-west track away from the equator, which surprises anyone who thinks of a sphere as a flat map with a single heading.
Rhumb lines versus great-circle tracks
A rhumb line* (loxodrome) cuts every meridian at the same angle: constant compass heading. It is the course a helmsman can steer without changing the compass card. On a Mercator chart it is a straight line. It is not the shortest path, except due north-south or along the equator.
The difference is small on a harbour hop and large on an ocean crossing. London to New York, rhumb versus great circle, is a few tens of nautical miles; the great circle goes farther north. Before inertial navigation, ocean sailing mixed the two: a rhumb that was easy to steer, or a sequence of rhumbs approximating the orthodrome. Airliners fly the great circle, or a wind-optimised cousin of it, and the constant-heading fantasy stays on the chart table.
This page computes the great circle only. A rhumb distance uses a different integral (the meridional parts of Mercator). Mixing the two formulae is how a “straight line on the map” is sold as a shortest path.
Earth radius: 6,371 km, WGS84, flattening
The default radius here is 6,371 km, a conventional mean. The Earth is an oblate ellipsoid. WGS84, the GPS ellipsoid, has an equatorial radius of 6,378,137 m and a flattening of 1/298.257223563. Polar radius is about 6,356.8 km. A spherical model with one R cannot match every route to the metre.
For most distances on this page the spherical error stays under about 0.5%. Metre-level geodesy uses an ellipsoidal formula (Vincenty’s method, or the more recent Karney algorithms). A surveyor closing a 20 km traverse does not want haversine on a sphere. A journalist quoting London–Sydney does.
Spherical model. For metre-level work on the real Earth, use an ellipsoidal geodesic. The gap is usually a fraction of a percent; it is not zero.
Other worlds: the same form with R = 1,737 km is the Moon, R = 3,390 km is Mars. The trigonometry does not know it is Earth. The radius box is the whole planet model.
A worked Atlantic crossing
The form defaults are Paris (48.8566° N, 2.3522° E) to New York (40.7128° N, 74.0060° W), R = 6,371 km. Δφ ≈ −8.14°, Δλ ≈ −76.36°. Haversine then gives Δσ ≈ 52.5° ≈ 0.916 rad, so d ≈ 5,837 km, give or take a few kilometres depending on rounding of the coordinates. The initial bearing is about 291.8°: west-north-west, roughly 22° north of west.
That is the great-circle length, not a flight-planned distance. Airways, winds, and North Atlantic Tracks add detours. The number remains the right yardstick: any real route is at least that long, on a sphere of that radius.
Swap in nautical miles in the result unit: 5,837 km is about 3,152 nmi. A minute of latitude is, by the old definition, one nautical mile; on a sphere of 6,371 km it is about 1.853 km, within a metre of the modern international nautical mile of 1.852 km. The two stories meet.
Antipodes and very short distances
Antipodes: Δσ = 180°, d = πR ≈ 20,015 km on this mean Earth. Every great-circle heading is then equally good, because every great circle through a point also through its antipode. The initial-bearing formula becomes ill-conditioned; the distance does not. Madrid and a patch of the North Island of New Zealand sit close to that story.
Very short distances: two corners of a square in Manhattan. Haversine returns a number. Whether that number is the walking distance is another matter: buildings, a grid, a river. The sphere is also a poor model of a city block because the local surface is better treated as a plane. For a few hundred metres, a flat Pythagorean calculation in a local tangent plane is simpler and no worse.
Identical points: Δσ = 0, distance 0, bearing undefined. The form will print a bearing from atan2 of zeros; it is not a direction anyone can fly.
Why airline routes look curved on a Mercator map
Mercator stretches parallels so that a rhumb line is straight. A great circle, which is “straight” on the sphere, therefore bows toward the nearest pole on that map. The London–Los Angeles track looks like an arc over Greenland. On a globe, or on a gnomonic chart (where great circles are straight), it is the taut string.
Passengers asking why the plane is “going the long way up north” are reading Mercator. The north is the short way. Polar routes from the eastern US to East Asia are the same illusion in a different ocean. The astronomy and navigation section is where that chart-versus-globe tension lives in the rest of the site; this page supplies the length and the first heading.
A gnomonic projection, centred on the route, makes the same track a straight segment. It wrecks shapes and distances away from the centre, which is why atlases do not use it for world maps, and why it remains a planning tool for a single ocean crossing.
Nautical miles and a minute of latitude
The historical nautical mile was defined as one minute of arc along a meridian. On a sphere that is R × π / (180 × 60). With R = 6,371 km the result is 1.852 km, and 1.852 km was later adopted as the international nautical mile, independent of the ellipsoid. On the real Earth a minute of latitude varies a little from equator to pole, because of flattening; the international mile no longer tracks that variation.
Speeds in knots are nautical miles per hour. A great-circle distance in nmi, divided by a speed in knots, is a time in hours, which is why the result unit menu includes nmi. Statute miles (the land mile) are a different beast; mixing them with nmi is a 15% error, the sort that does not look obvious on a screen.
Vincenty versus haversine for surveying
Vincenty’s 1975 formulae iterate on the ellipsoid. They were the geodesist’s default for decades. They struggle on nearly antipodal points; Karney’s 2013 algorithms do not. None of that is this page. Haversine on a sphere is the right complexity for a first distance, a lesson in spherical trigonometry, and a check against a globe.
A cadastral survey, a tunnel, a national grid: ellipsoid, datum, and projection. WGS84 latitudes pasted here ignore the grid’s scale factor. The plane triangle solver is then the local tool, once the work has been reduced to a map plane. Spherical distance is the middle layer: larger than a field, smaller than a need for millimetres across an ocean.
Spherical coordinates are the native language of the same geometry: colatitude 90° − φ, longitude as azimuth, r = R. The haversine is what remains after those coordinates have been subtracted.
Glossary
- Great circle
- The intersection of a sphere with a plane through its centre. It is the largest circle that can be drawn on the sphere. Meridians and the equator are great circles; other parallels are not.
- Orthodrome (great-circle track)
- The shorter arc of the great circle joining two points. It is the shortest path on the sphere. Its length is the radius times the central angle in radians.
- Haversine
- hav(θ) = sin²(θ/2). Used in the spherical distance formula because it remains accurate for small separations, where a direct spherical cosine plus arccos would lose precision.
- Rhumb line (loxodrome)
- A path of constant compass heading, cutting meridians at a constant angle. Straight on a Mercator chart; longer than the great circle except due north-south or along the equator.