North Pinnacle

Sheet 2 · Distance

Distance between two coordinates

The shortest distance over the earth's surface between two positions, measured on the ellipsoid and on a sphere so you can see how much the shape of the earth matters.

Input

Any format works: decimal, DMS, UTM or MGRS.

Try:

Readout

Geodesic distance on WGS84

5,585.23 km

3,470.50 mi · 3,015.78 nmi

MethodDistanceVersus Karney
Karney (2013), ellipsoid5,585.23 kmreference
Vincenty (1975), ellipsoid5,585.23 km+0.000 m (+0.000%)
Haversine, sphere R = 6,371.0088 km5,570.23 km−15,004 m (−0.269%)
Initial bearing
288.4° (WNW)
Final bearing
231.2° (SW)

Sphere or ellipsoid?

The quick answer treats the earth as a sphere and uses the haversine formula, with φ for latitude, λ for longitude and R for the radius:

a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2); d = 2R · atan2(√a, √(1−a))

But the earth is flattened at the poles by about 1 part in 298, so a sphere is off by up to about 0.5%. From London to New York the haversine answer, with the mean radius of 6,371.0088 km, comes out about 15 km short of the ellipsoidal 5,585 km.

Ellipsoidal methods solve the problem on the WGS84 ellipsoid itself. Vincenty's formula (1975) iterates to millimetre accuracy but can fail to converge when the points are almost opposite each other on the globe; try the "nearly antipodal" example. Karney's algorithm (2013) always converges and is accurate to about 15 nanometres, so it is the reference here.

Sources

Questions

Is this the driving or flying distance?

Neither. It is the shortest path over the ellipsoid's surface, ignoring roads, terrain and air routes. Long-haul flights roughly follow it, bent by winds and airspace.

Why do distance calculators disagree slightly?

Most use the haversine formula, some with a radius of 6,371 km and some 6,378 km; that choice alone moves results by about 0.1%. Ellipsoidal methods agree with each other to within a millimetre.

What does "did not converge" mean?

For nearly antipodal points Vincenty's iteration keeps overshooting and never settles. The Karney result is still exact, so the distance shown is reliable.