Distance in a 2D plane
The distance between (1, 2) and (4, 6) is exactly 5.
Result
Fill in the fields to see your result.
In a flat plane (2D or 3D), the distance formula is just the Pythagorean theorem extended: square each coordinate difference, add them, and take the square root. On a sphere, straight-line geometry does not apply, so the haversine formula instead computes the great-circle distance — the shortest path along the curved surface — from the two points' latitude and longitude.
The geographic mode also reports the initial bearing: the compass direction you would need to head at the start of the great-circle path (which, over long distances, is not the same as pointing straight at the destination on a flat map).
d = √((x₂ − x₁)² + (y₂ − y₁)²)
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
d = 2R · asin(√(sin²(Δφ/2) + cos φ₁·cos φ₂·sin²(Δλ/2)))
The distance between (1, 2) and (4, 6) is exactly 5.
Paris (48.8566°N, 2.3522°E) to London (51.5074°N, −0.1278°E) is about 343.6 km as the crow flies.
Latitude and longitude are angles on a sphere, not coordinates on a flat grid — a degree of longitude covers a different real-world distance near the equator than near the poles, so the flat formula would give badly wrong results over any real distance.
It treats the Earth as a perfect sphere, which is accurate to within about 0.5% — good enough for most purposes, though a more complex ellipsoidal model (like Vincenty's formula) is used where higher precision is needed.
This gives the shortest theoretical path — a straight line in a plane, or a great-circle arc over the globe — while roads, flight paths and terrain add detours that a straight-line calculation cannot capture.
Bearing is the compass direction of travel. On a great-circle route between distant points, the bearing actually changes continuously along the path — the "initial bearing" reported here is only the heading at the very start of the journey.
Updated