CalcForAll

How Distance Is Calculated on a Sphere — The Haversine Formula Explained

Blog › Math · 7 min read · Published 2026-03-01

Learn how the Haversine formula calculates the shortest distance between two points on Earth's surface.

Why Flat-Map Distance Is Wrong

The Earth is a sphere. The shortest path between two surface points is an arc called a great circle, not a straight line on a flat map.

The Haversine Formula

a = sin²(Δφ/2) + cos(φ₁)·cos(φ₂)·sin²(Δλ/2); c = 2·atan2(√a, √(1−a)); d = R × c where R ≈ 6,371 km.

Example

New York to London: ~5,570 km via Haversine.

Applications

  • Aviation: long-haul routes follow great circles
  • GPS navigation uses spherical geometry
  • Submarine cable routing

Related calculators