How to find the distance between two coordinates
- Type the two points as latitude, longitude, in decimal degrees (51.5074, -0.1278) or degrees, minutes and seconds (51°30′27″N 0°07′40″W).
- Choose kilometres, miles or nautical miles.
- Read the distance along the Earth’s surface, the haversine figure for comparison, the bearing to set off on and the midpoint of the route.
The haversine formula
For two points with latitudes φ₁, φ₂ and longitudes λ₁, λ₂ (in radians):
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2), and the distance is d = 2R · asin(√a)
with R the Earth’s mean radius, 6,371.0088 km (the IUGG value). It is easy to code and good enough for most uses.
Vincenty’s formula
Thaddeus Vincenty published his method in 1975. It solves the shortest path on an ellipsoid by iterating until the answer settles, and it reproduces Vincenty’s own test case, 54,972.271 m from Flinders Peak to Buninyong in Australia, to the millimetre. Use it when the half-percent error of a sphere matters, for example in surveying or checking GPS tracks.