Great Circle Route Calculator: How It Works
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator works out the shortest surface distance between two points on a sphere (the great-circle distance) and, optionally, the initial bearing you would set off on. Enter the latitude and longitude of your origin and destination, and you get the distance in kilometers or miles, plus the starting heading in degrees.
Formula
The calculator uses the haversine formula, which gives great-circle distances on a sphere of radius R. For two points with latitudes φ�, φ₂ and longitude difference Δλ,
a = sin²(Δφ/2) + cos φ� · cos φ₂ · sin²(Δλ/2)
c = 2 · atan2(√a, √(1−a))
distance = R · c
where Δφ = φ₂ − φ�. The Earth’s mean radius is taken as 6,371 km (3,959 mi). The bearing is computed with the four-quadrant arctangent:
θ = atan2( sin Δλ · cos φ₂, cos φ� · sin φ₂ − sin φ� · cos φ₂ · cos Δλ )
and normalized to 0–360°.
Worked Example
Take the default values: London (51.5° N, 0.12° W) to New York (40.71° N, 74.01° W).
- Convert to radians: φ� = 0.899 rad, φ₂ = 0.710 rad, Δφ = −0.189 rad, Δλ = −1.291 rad.
- Compute a = sin²(−0.0945) + cos(0.899)·cos(0.710)·sin²(−0.6455) ≈ 0.00892 + 0.6217·0.7560·0.3684 ≈ 0.00892 + 0.1730 = 0.1819.
- c = 2·atan2(√0.1819, √0.8181) ≈ 2·0.4421 = 0.8842 rad.
- Distance = 6371 × 0.8842 ≈ 5,634 km (3,501 mi).
- Bearing: θ ≈ atan2( sin(−1.291)·0.7560, 0.6217·0.710 − 0.899·0.7560·cos(−1.291) ) ≈ −0.728 rad → 288.3°.
The calculator shows 5,634.0 km, 3,501.0 mi, and bearing 288.3°.
What Is a Great Circle?
A great circle is the largest circle that can be drawn on a sphere; its center coincides with the sphere’s center. The equator, all meridians of longitude, and the International Date Line are great circles. Any other line of latitude (except the equator) is a small circle, so it is not the shortest path. On a flat map, a great circle looks like a curve, which is why flight paths appear arched on standard projections. The great-circle distance is the true shortest surface distance, ignoring terrain and obstacles.
How to Use the Calculator
- Enter coordinates in decimal degrees; use negative for south and west (e.g., Sydney is −33.87, 151.21).
- The distance output is the great-circle distance in kilometers and miles.
- The bearing is the initial compass heading from the origin; as you travel, the bearing changes (this is initial bearing).
- For antipodal points (opposite sides of the globe), the distance is approximately 20,015 km (12,437 mi) on a sphere of radius 6,371 km.
Common Mistakes and Limitations
- Unit mix-ups: Entering degrees when the formula expects radians is a classic error. This calculator handles the conversion internally, but if you adapt the formula, be careful.
- Earth is not a perfect sphere: The haversine formula assumes a sphere. The Earth is an oblate spheroid; the error is typically less than 0.5% for most routes. For higher accuracy, use Vincenty’s formulae (ellipsoidal), but for most navigation and planning, haversine is sufficient.
- Bearing wrap-around: Bearings are reported 0–360°; ensure your calculator handles negative results (add 360).
- Short distances: For very close points, the haversine formula suffers from rounding errors; use the spherical law of cosines or Vincenty for sub-kilometer distances.
- Not for routing: The great-circle path is the shortest on a sphere, but real travel (air, sea, land) must follow routes, avoid obstacles, and account for winds, currents, and airspace.
Real-World Applications
- Aviation: Flight planners use great-circle routes to minimize fuel and time. For example, a flight from Los Angeles to Tokyo goes north over Alaska and the Aleutians, not straight across the Pacific.
- Maritime navigation: Ships follow great-circle segments on long ocean passages, adjusting for currents and weather.
- Telecommunications: Satellite dishes and radio antennas point along great-circle bearings to reach geostationary satellites.
- Travel planning: Understanding great circles explains why a flight from Europe to the US West Coast often flies over Greenland.
Alternatives and Advanced Methods
For more precise geodesic distances on the Earth’s ellipsoid, use Vincenty’s formulae, which iteratively solve for the geodesic. The error is sub-millimeter for most points. Another option is the spherical law of cosines: d = R · acos( sin φ� sin φ₂ + cos φ� cos φ₂ cos Δλ ), which is fine for most distances but can be unstable for very short distances. Online mapping APIs (e.g., Google Maps) provide road and walking distances, which are not great-circle distances. For planning a flight path with waypoints, you would break the route into segments and sum the great-circle distances.
Frequently Asked Questions
What is the difference between great-circle and straight-line distance?
A straight line through the Earth’s interior is the chord, but the great-circle distance is the shortest path along the surface. For example, the straight-line (3D) distance between London and New York is about 5,570 km, while the surface great-circle distance is 5,634 km.
Why do flight paths look curved on maps?
Most world maps use the Mercator projection, which distorts distances and angles. A great circle appears as a curve because the projection cannot represent the sphere’s geometry without distortion. On a globe, the great-circle route looks straight.
How accurate is the haversine formula?
For most distances, the error is under 0.5% compared to ellipsoidal models. For a 10,000 km route, that is about 50 km. For precise survey or navigation, use Vincenty’s formulae or a geodetic library.
Can I use this calculator for any two points on Earth?
Yes, as long as you provide valid coordinates (latitude between −90 and 90, longitude between −180 and 180). The formula works for any pair, including antipodal points.
How do I convert degrees, minutes, seconds to decimal degrees?
Divide minutes by 60 and seconds by 3600, then add to the degrees. For example, 40° 42′ 46″ N = 40 + 42/60 + 46/3600 = 40.7128°. For south or west, use a negative sign.
Related
Formula used
in lat1 | Origin latitude | deg | 51.5 | -90 in lon1 | Origin longitude | deg | -0.12 | -180 in lat2 | Destination latitude | deg | 40.71 | -90 in lon2 | Destination longitude | deg | -74.01 | -180 out d_km | Great-circle distance | km | 2 * 6371 * asin(sqrt(sin((rad(lat2)-rad(lat1))/2)^2 + cos(rad(lat1)) * cos(rad(lat2)) * sin((rad(lon2)-rad(lon1))/2)^2)) | 1 out d_mi | Distance in miles | mi | d_km * 0.621371 | 1 out bearing | Initial bearing | deg | (deg(atan2(sin(rad(lon2-lon1)) * cos(rad(lat2)), cos(rad(lat1)) * sin(rad(lat2)) - sin(rad(lat1)) * cos(rad(lat2)) * cos(rad(lon2-lon1)))) + 360) % 360 | 1
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.