Great-Circle Distance Explained
Ask for the distance between two places and you are really asking a geometry question with a trap in it: the coordinates you have — latitude and longitude — are angles on a curved surface, not points on a flat sheet, so the familiar straight-line formula quietly gives the wrong answer. This guide builds the right one from first principles: why a naive Euclidean distance fails on a sphere, the great-circle shortest path, the haversine formula worked step by step between two real cities, how a constant-heading rhumb line trades length for simplicity, how to compute the bearing you set off on, and the honest limit every spherical calculation shares — the Earth is not actually a sphere.
Why a flat straight-line distance is wrong
A latitude/longitude pair is two angles, not a position on graph paper: latitude measures how far north or south of the equator you are, longitude how far east or west of the prime meridian. The tempting move is to treat those two numbers like x and y and reach for the Pythagorean theorem — √(Δlat² + Δlon²) — but that assumes the grid is uniform and flat, and neither is true.
One degree of latitude is roughly constant at about 111 km everywhere. One degree of longitude is not: the meridians all meet at the poles, so a degree of longitude is about 111 km at the equator, about 78 km at 45° latitude, and shrinks toward zero near a pole. Multiplying a longitude difference by a fixed kilometres-per-degree overstates east–west distance the farther you are from the equator. And even a corrected flat distance is a chord through the planet or a projection onto a plane — it ignores that the real shortest path bends around a curved surface. Over a few hundred metres this is negligible; over hundreds of kilometres it is a serious error.
The great-circle (orthodromic) path
A great circle is any circle you can draw on a sphere whose centre coincides with the centre of the sphere. The equator is a great circle; so is every line of longitude paired with its opposite meridian. Cut a sphere through its middle in any orientation and the rim you expose is a great circle. The key fact of spherical geometry is this: the shortest path between two points on a sphere always lies along the great circle through them both, following the shorter of its two arcs. That arc length is the great-circle (or orthodromic) distance — the true as-the-crow-flies distance over a round Earth. It is why intercontinental flight paths, drawn on a flat map, appear to bow poleward: the straight-looking line on the map is actually the longer way around.
The haversine formula in plain terms
The haversine formula turns two coordinate pairs into that arc length. It first finds the central angle the two points subtend at the centre of the Earth, then multiplies that angle (in radians) by the Earth's radius to get the arc length. "Haversine" is just the half-versed-sine, hav(θ) = sin²(θ/2); the formula is written that way because it stays numerically stable even for very small distances, where a plain spherical-law-of-cosines version loses precision. Below, φ is latitude and λ is longitude in radians, and Δφ, Δλ are the differences between the two points:
a = sin²(Δφ/2) + cos(φ₁)·cos(φ₂)·sin²(Δλ/2)
c = 2·atan2(√a, √(1−a))
distance = R · c
Here a relates to the chord between the points, c is the central angle in radians, and R is the Earth's mean radius. The atan2(√a, √(1−a)) step is a robust way to recover the angle from a that behaves correctly all the way out to antipodal points.
Which Earth radius — and the honest number
Because haversine treats the Earth as a perfect sphere, it needs one radius to stand in for a shape that does not actually have one. Polyatic's distance calculator uses the value defined in its vendored geodesy library, distance-calculator/vendor/geo-distance.js:
This is the IUGG mean radius R1, the arithmetic mean of the WGS-84 ellipsoid's three axes — the equatorial semi-major axis a = 6,378,137 m counted twice and the polar semi-minor axis b ≈ 6,356,752 m once. The round 6371 km in most textbook haversine snippets is simply this figure rounded to the nearest kilometre; the extra digits are not invented precision but the exact mean of the reference ellipsoid the calculator approximates. Using the full value keeps the spherical answer honestly consistent with the ellipsoidal one beside it.
Worked example: London to Paris
Take two concrete points, London and Paris, in decimal degrees:
Convert the differences to radians (multiply degrees by π/180) and run the three steps:
So the great-circle distance London → Paris is 343.56 km (about 213.5 mi, or 185.5 nautical miles — a nautical mile is one minute of arc, so the arc angle 3.0897° × 60 ≈ 185.4′ gives the nautical-mile figure almost directly). Every number came from the two coordinate pairs and the one radius constant. Feed the same points into the ellipsoidal Vincenty method and you get 343.92 km — a disagreement of just 0.36 km, about 0.1%, the size of correction we return to below.
Great circle vs rhumb line
The great circle is the shortest path, but not the simplest to steer: its compass heading changes continuously as you cross successive non-parallel meridians. The alternative is a rhumb line (or loxodrome), a path of constant bearing — hold a single heading the whole way and you trace one. It appears as a straight line on a Mercator chart and is trivial to follow with a compass. The cost is length: a rhumb line is always at least as long as the great circle, and noticeably longer over long east–west spans at high latitude. For London → Paris the difference is tiny, but on a transatlantic crossing a great circle saves a meaningful fraction of the distance — which is why long-haul navigation historically approximated one as a series of short rhumb-line legs, re-checking the heading at each waypoint.
Computing the initial bearing
The initial bearing is the compass direction you set off in at the start of the great-circle path, measured in degrees clockwise from true north (0° = north, 90° = east, 180° = south, 270° = west). It comes from a single atan2 expression:
θ = atan2( sin(Δλ)·cos(φ₂), cos(φ₁)·sin(φ₂) − sin(φ₁)·cos(φ₂)·cos(Δλ) )
For London → Paris the numerator works out to 0.028470 and the denominator to −0.045766, so θ = atan2(0.028470, −0.045766) = 148.1° — a heading of roughly SSE, which matches the direction Paris actually lies from London. Because the great circle curves, the heading is not fixed: arrive in Paris and you are travelling on about 150.0° (the final bearing). Initial and final bearing are equal only along the equator or a pure north–south meridian; everywhere else the number you set off on is not the number you arrive on.
The honest accuracy limit
Every step above assumed the Earth is a sphere. It is not — it is an oblate ellipsoid, roughly 21 km wider across the equator than from pole to pole. Haversine collapses that shape to a single mean radius, so its answer carries a built-in approximation error that depends on where you are and which way the path runs; in practice the spherical result lands within a few tenths of one percent of the exact WGS-84 ellipsoidal distance. The London → Paris case makes the size concrete: haversine gives 343.56 km, and Vincenty's inverse formula on the WGS-84 ellipsoid gives 343.92 km — a difference of 0.36 km, about 0.1%. Vincenty is accurate to well under a metre for the model, at the price of an iterative computation that does not converge cleanly for near-antipodal points, where haversine remains the stable fallback.
For map distances, radius questions, flight-distance sanity checks and bearings, that fraction of a percent is invisible and haversine is the right tool. When you genuinely need survey-grade precision, reach for an ellipsoidal method (Vincenty or the modern Karney algorithm) instead. Both share one caveat: they measure the shortest path over the surface as the crow flies, knowing nothing of roads, terrain or altitude, so a real journey is always longer.
Paste two lat, lon pairs and watch the great-circle distance in km, miles and nautical miles, the initial and final bearing with a compass label, and the midpoint update live — the haversine and Vincenty methods worked through above, side by side, in your browser.
Putting it together
Distance on the Earth is a spherical-geometry problem wearing a deceptively flat coordinate system. Treat latitude and longitude as flat x/y and you overstate east–west distance and ignore curvature; treat them correctly and the shortest path is the great circle through both points. The haversine formula turns two coordinate pairs into that arc — a central angle times the IUGG mean radius 6,371,008.771 m — and for London → Paris returns 343.56 km, within about 0.1% of the ellipsoidal 343.92 km. Add the initial bearing to know which way to set off, remember that a constant-heading rhumb line is simpler but longer, and keep the honest caveat in view: on an ellipsoid, a spherical answer is an excellent approximation, not the last word.
Open the Distance & Bearing Calculator → to measure your own coordinates, or browse all Polyatic tools.