Great Circle Distance & Bearing

Distance and bearing between two coordinates on both a sphere and the real ellipsoid, plus why the bearing home is not the reverse of the bearing out.

Both models are shown because they disagree by enough to matter. Nothing is uploaded.

Treating the Earth as a sphere costs kilometres

Haversine assumes a sphere. The Earth is flattened by about 1 part in 298, and the difference is not academic: the worst of these routes is out by 34 km, or 0.374%.

RouteSphereEllipsoidDifference%
London → New York 5570.2 km 5585.2 km -15.00 km -0.269
Sydney → Santiago 11346.7 km 11369.0 km -22.25 km -0.196
Quito → Nairobi 12818.4 km 12832.7 km -14.34 km -0.112
Oslo → Cape Town 10458.2 km 10423.8 km 34.44 km 0.330
Anchorage → Reykjavik 5418.6 km 5439.0 km -20.34 km -0.374

The error changes sign, so it cannot be corrected with a fudge factor. North-south legs read long and east-west legs read short, because a single sphere is too small near the poles and too large at the equator. Vincenty's method works on the real ellipsoid and is accurate to a fraction of a millimetre — at the cost of an iteration that can fail to converge on nearly antipodal points, which this reports rather than papering over.

The bearing home is not the reverse of the bearing out

Leave London for New York on 288° and the initial bearing from New York back to London is 51°, not 108°. The gap is 57 degrees, and on one route here it reaches 122°.

RouteBearing outBearing backOut + 180Gap
London → New York 288.3° 51.2° 108.3° 57.1°
Sydney → Santiago 145.3° 214.5° 325.3° 110.8°
Quito → Nairobi 91.5° 269.2° 271.5° 2.3°
Oslo → Cape Town 173.6° 356.2° 353.6° 2.5°
Anchorage → Reykjavik 27.2° 329.7° 207.2° 122.4°

Nothing is wrong. A great circle is not a straight line on a globe, and the direction it points changes continuously along its length — which is why "initial bearing" is the only bearing worth quoting. The effect nearly vanishes on routes along the equator, where Quito to Nairobi is symmetric to within 2.3°, and it is worst on routes crossing high latitudes. Along a meridian it disappears entirely.

A constant compass bearing is longer

A rhumb line holds one heading the whole way, which is far easier to steer and never shorter. The excess reaches 20.5% on these routes — the trade sailors made for centuries, before it was practical to keep turning.

RouteGreat circleConstant bearingLonger by
London → New York 5570 km 5794 km 4.0%
Sydney → Santiago 11347 km 12784 km 12.7%
Quito → Nairobi 12818 km 12819 km 0.0%
Oslo → Cape Town 10458 km 10459 km 0.0%
Anchorage → Reykjavik 5419 km 6532 km 20.5%

Two cases where they coincide, and both are instructive: along the equator and along any meridian the great circle already is a constant bearing, so there is nothing to give up. Oslo to Cape Town is nearly north-south and its excess rounds to zero for exactly that reason.

Why the route looks bent on a map

The London to New York great circle reaches 53.8°N at its highest point — north of London itself, and well north of New York. That is not the aircraft wandering; it is the shortest path. A flat map has to distort something to lay a sphere out on a rectangle, and what it distorts is exactly this: the straight line on the paper is the longer route, and the curve is the direct one.

How to use

  1. Enter two latitude and longitude pairs.
  2. Compare the spherical and ellipsoidal distances.
  3. Read the initial bearing — and the one coming back.
  4. See how much longer a constant compass heading would be.

Frequently asked questions

What is the difference between haversine and Vincenty?

Haversine treats the Earth as a sphere, which is simple and always converges. Vincenty works on the WGS-84 ellipsoid, which is the real shape, and is accurate to a fraction of a millimetre. The Earth is flattened by about 1 part in 298, and that flattening is what the two disagree about.

How much does the sphere assumption cost?

Up to 0.374 per cent on the routes here, which is 34 kilometres on Oslo to Cape Town and 15 on London to New York. Whether that matters depends on what you are doing, but it is not a rounding error.

Can I just multiply by a correction factor?

No, because the error changes sign. North-south legs read long and east-west legs read short, since a single sphere is too small near the poles and too large at the equator. A scale factor that fixed one would make the other worse.

Why is the bearing back not the bearing out plus 180?

Because a great circle is not a straight line on a globe, and the direction it points changes continuously along its length. Leave London for New York on 288 degrees and the initial bearing from New York back to London is 51, not 108. On one route here the gap reaches 122 degrees.

When does that symmetry hold?

Along a meridian, exactly, and very nearly on routes that run along the equator — Quito to Nairobi is symmetric to within a couple of degrees. The effect grows with how much latitude the route crosses, which is why high-latitude routes are the worst offenders.

What is a rhumb line?

A course that holds one constant compass bearing the whole way. It is far easier to steer and never shorter — the excess reaches 20 per cent on these routes. Sailors made that trade for centuries, before it was practical to keep turning.

When are the two the same length?

Along the equator and along any meridian, because there the great circle already is a constant bearing so there is nothing to give up. Oslo to Cape Town is nearly north-south and its excess rounds to zero for exactly that reason.

Why do flight paths look curved on a map?

Because the map is distorting the shape, not the aircraft its route. The London to New York great circle reaches 53.8 degrees north at its highest point — north of London itself. The straight line on the paper is the longer route.

Does this send anything anywhere?

No. Everything is computed in your browser, and nothing is uploaded.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.