London to Paris is about 344 km. The great-circle distance is the shortest path over a sphere, and it is not what a straight line on a flat map shows. The bearing changes along the way, which is why long flights appear to curve on a Mercator projection.
Why the shortest path curves
On a flat surface the shortest path is a straight line. On a sphere there are no straight lines, and the shortest path is an arc of a great circle — a circle whose centre is the centre of the sphere.
The equator is one. So is every line of longitude. Lines of latitude other than the equator are not, which is why flying due east along the 50th parallel is not the shortest way to a place due east of you.
A flight from London to Tokyo goes near the North Pole, and on a Mercator map that looks like a detour. It is not: the map is what is distorted, and the great circle is genuinely shorter.
Any two points lie on exactly one great circle — except antipodal points, where infinitely many pass through both and there is no unique shortest path at all. This page flags that case, because every formula becomes ill-conditioned there.
Which formula to use
Three are in common use, and they are not equally good.
Haversine is the one to use. It computes from the sine of a half-angle, which stays accurate all the way down to metres. It is what this page reports.
The spherical law of cosines is what most references give, and it takes an arccos of a value very close to 1 for short distances. acos has an unbounded derivative there, so it loses roughly half its significant digits — in double precision that is sub-millimetre at ten metres, and in the single precision these formulas were originally written for it was metres. That is why haversine exists.
The equirectangular approximation treats a patch of the globe as flat. It is crude, it is very fast, and it is genuinely useful for sorting nearby results by proximity where the ordering matters more than the values. It degrades away from the equator and over distance.
All three are shown above so the differences are numbers rather than claims.
The bearing changes
Set off along a great circle on a heading of 90° and you will not still be heading 90° when you arrive. The bearing changes continuously.
It happens because the meridians converge towards the poles, so a path that keeps a constant angle to them is not a straight line on the sphere.
A path that does hold a constant bearing is a rhumb line. It is longer — sometimes much longer — and it is what a straight line on a Mercator map represents. That is the whole point of the Mercator projection: it was designed so navigators could draw a straight line and steer one heading, at the cost of distance.
This page reports both the initial and the final bearing, so the difference is visible. On a Sydney to Tokyo route they are tens of degrees apart.
The Earth is not a sphere
This page treats the Earth as a sphere of mean radius 6,371 km. It is not one.
It is an oblate spheroid, flattened at the poles by about a part in 300 — the equatorial radius is roughly 6,378 km and the polar radius about 6,357 km, a difference of some 21 km.
So a spherical calculation can be off by up to roughly 0.5%. Over 1,000 km that is about 5 km, which is fine for most purposes and not fine for surveying or aviation.
Vincenty’s formulae work on the WGS-84 ellipsoid and are accurate to millimetres. They are iterative, they converge slowly for nearly antipodal points, and they are what GPS and geodetic software use.
Which to choose is a real decision rather than a technicality. Sorting nearby restaurants does not need Vincenty; setting out a boundary does.
Where it gets used
Aviation and shipping. Flight planning is great-circle routing modified for wind and airspace, and the apparent curves on a route map are the shortest paths.
Location search. “Find the nearest” is a distance sort, usually done with the cheap approximation first and the accurate formula on the shortlist.
Radio and satellites. Antenna pointing and coverage footprints are great-circle calculations.
Geography and logistics. Service areas, delivery zones and the straight-line distances that road distances are compared against.
Sources and methodology
The formulas and the ellipsoid model are standard; these are the references.
Method. Haversine is the reported answer because it is numerically stable at short range: it works from the sine of a half-angle rather than from an inverse cosine. The spherical law of cosines is computed alongside and the disagreement is measured and stated, rather than the page simply asserting that one is better — in double precision that gap is sub-millimetre at ten metres, and claiming metres of error would have been the easier sentence and the wrong one. The suite verifies every distance against an independent vector dot-product derivation. That engine is verified on every change against 99 hand-written assertions, including that haversine matches an independent vector derivation on every city pair tested, that distance is symmetric across five hundred generated coordinate pairs, and that no distance exceeds half the circumference. The count and the per-case breakdown are published on the formula verification page.
Read the guide
The same inverse-cosine conditioning problem appears when taking the angle between two nearly-parallel vectors — the Vector Calculator handles it the same way.