The shortest way between two cities isn’t the straight line on a flat map — it’s a curve, the arc of the great circle that a taut string would trace on a globe. That’s why flights from New York to Tokyo swing up over the Arctic. Slide the destination and read the true distance the haversine gives.
On a sphere the shortest path between two points is an arc of the GREAT CIRCLE (a circle whose plane passes through the centre). Its length from the haversine formula is d = 2R·asin√(sin²(Δφ/2) + cosφ₁cosφ₂sin²(Δλ/2)), with R the Earth’s radius. A fail-loud self-check throws unless New York–London comes out ~5570 km — the number that makes polar routes shorter than they look on a Mercator map.
A perfect-sphere model; the Earth is an oblate spheroid, so precise navigation uses Vincenty’s ellipsoidal formula (differing by up to ~0.5%). The great-circle geometry and the haversine distance are exact for the sphere.