Formula and Method for Great-Circle Distance
A great circle is the largest possible circle that can be drawn on a sphere — its plane always passes through the sphere's center. The arc of a great circle between any two points is the shortest possible path between them along the surface, which is why it is the route ships and aircraft actually follow for long-distance travel. This calculator finds that distance, plus the compass bearings and midpoint, from two latitude/longitude coordinates using the haversine formula.
How the calculation works
Convert both points' latitude (φ) and longitude (λ) to radians. Compute the differences Δφ = φ2 − φ1 and Δλ = λ2 − λ1, then apply the haversine formula: a = sin²(Δφ/2) + cos φ1 · cos φ2 · sin²(Δλ/2), followed by c = 2 · atan2(√a, √(1−a)). Multiplying c by Earth's mean radius R (about 6,371 km) gives the great-circle distance d = R · c. The initial bearing (compass heading leaving point 1) is θ = atan2(sin Δλ · cos φ2, cos φ1 · sin φ2 − sin φ1 · cos φ2 · cos Δλ), normalized to 0–360°. The final bearing is found by running the same formula from point 2 to point 1 and reversing the direction by 180°. The midpoint is the point exactly halfway along the great-circle arc, found with a separate vector-based formula.
Common mistakes
- Degrees vs. radians: latitude and longitude are entered in degrees, but trigonometric functions need radians. Forgetting to convert (multiply by π/180) gives wildly wrong results.
- Sign conventions: longitude is negative west of the Prime Meridian and positive east; latitude is negative south of the equator and positive north. Entering the wrong sign can place a point on the opposite side of the planet.
- Great circle vs. straight line on a map: a great-circle route often looks curved on a flat (Mercator) map even though it is the shortest real-world path — that curvature is a map projection artifact, not a longer route.
Real-world applications
- Airlines and shipping routes use great-circle paths to minimize fuel and travel time on long-haul journeys.
- Celestial navigation and orienteering use bearings computed the same way to plot a course between waypoints.
- GIS, mapping, and geofencing software use the haversine formula to compute distances between GPS coordinates.
- Radio and satellite communications use great-circle bearings to aim antennas at the shortest path to a target location.