Sphere or ellipsoid?
The haversine formula treats the Earth as a sphere and is numerically stable even for very short distances. The Earth is actually flattened at the poles by about 1 part in 298, so spherical distances can be off by up to about 0.5 %. Vincenty’s iterative method on the WGS 84 ellipsoid is accurate to about half a millimetre, though it can fail to converge for points almost exactly opposite each other on the globe.
Assumptions and limits
- Distances along the surface of the reference ellipsoid (sea level); altitude and terrain ignored.
- Coordinates in decimal degrees on WGS 84 (as used by GPS).
- The spherical result uses the IUGG mean radius 6371.0088 km unless changed.
References
- Vincenty, T. (1975), Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations, Survey Review 23(176), 88–93.
- Sinnott, R. W. (1984), Virtues of the haversine, Sky and Telescope 68(2), 159.
- National Geospatial-Intelligence Agency, World Geodetic System 1984, NGA.STND.0036.
Questions
- How far is it from London Heathrow to New York JFK?
- 5555 km (3452 mi) on the WGS 84 ellipsoid and 5540 km by the haversine formula on a sphere, with an initial bearing of 288.0°.
- Why do the two methods differ?
- The sphere ignores the Earth’s flattening. For this route the spherical result is 0.27 % shorter.
This calculator is a design aid. Check results against the governing code or standard and have critical work verified by a qualified engineer. Read the disclaimer.