ThisCalculator

Math

Great Circle Calculator: Distance & Formula

Updated · Standard formula, shown below

Distance 5,570.2 km
Distance
3,461.2 miles
Result
Initial bearing
288.3 °
Result
Latitude of point 1
51.5074 °
You entered

Great Circle Calculator: Distance & Formula

This calculator works out the shortest distance between two points on the surface of a sphere (the great-circle distance) using their latitude and longitude. You enter the coordinates of the two points in decimal degrees, and you get back the distance in kilometers or miles, along with the initial bearing. The calculation uses the haversine formula, which is accurate for most practical purposes on Earth.

Formula

The great-circle distance is calculated with the haversine formula:

a = sin²(Δφ/2) + cos φ1 · cos φ2 · sin²(Δλ/2)

c = 2 · atan2(√a, √(1−a))

d = R · c

Where:

  • φ1, φ2 are the latitudes of point 1 and point 2 (in radians)
  • Δφ = φ2 − φ1 (difference in latitude, in radians)
  • Δλ = λ2 − λ1 (difference in longitude, in radians)
  • R is the mean Earth radius: 6,371 km (3,959 mi)
  • d is the great-circle distance (in the same unit as R)

The initial bearing (also called forward azimuth) is given by:

θ = atan2( sin Δλ · cos φ2 , cos φ1 · sin φ2 − sin φ1 · cos φ2 · cos Δλ )

Bearings are measured clockwise from true north (0° to 360°).

Worked Example

Using the default values: London (51.5074° N, −0.1278° E) and New York (40.7128° N, −74.0060° E).

  1. Convert degrees to radians: φ1 = 51.5074° × π/180 = 0.89897 rad, φ2 = 40.7128° × π/180 = 0.71057 rad, Δφ = −0.18840 rad, Δλ = −1.28848 rad.
  2. Compute sin²(Δφ/2) = sin²(−0.09420) = 0.00884.
  3. Compute cos φ1 · cos φ2 · sin²(Δλ/2) = 0.6225 × 0.7581 × sin²(−0.64424) = 0.4719 × 0.3587 = 0.1692.
  4. a = 0.00884 + 0.1692 = 0.1780.
  5. c = 2 · atan2(√0.1780, √0.8220) = 2 × 0.4358 = 0.8716 rad.
  6. d = 6371 × 0.8716 = 5551 km (rounded to 1 decimal: 5551.0 km).

The calculator gives 5551.0 km and 3449.0 miles. The initial bearing is about 288.6° (west-northwest).

When to Use the Great Circle Distance

Use this calculator for any situation where you need the shortest path between two points on a sphere:

  • Flight planning: aircraft follow great-circle routes to save fuel and time.
  • Marine navigation: ships use great-circle routes for long ocean passages.
  • Satellite and communications: calculating distances between ground stations.
  • Outdoor activities: estimating straight-line distances between coordinates (e.g., hiking, geocaching).
  • General geography: finding the distance between two cities.

For short distances (under about 20 km), the great-circle distance is nearly identical to the flat-earth (Pythagorean) distance if you correct for latitude. For long distances, the great-circle is always shorter than any rhumb line (a line of constant bearing).

How to Read the Result

The distance is the length of the shortest arc on the surface of a sphere. It is not the straight-line distance through the Earth (that would be the chord length). The initial bearing is the direction you would set off from point 1 to follow the great circle. Because a great circle is not a straight line on a map (except on a gnomonic projection), the bearing changes continuously along the route.

For example, flying from London to New York, you start heading about 288° (west-northwest), but as you cross the Atlantic, the bearing shifts gradually to the southwest. The final bearing at New York is different from the initial one.

Common Mistakes and Limitations

  • Unit mix-ups: The formula expects latitudes and longitudes in decimal degrees. If you have degrees, minutes, seconds, convert to decimal first (e.g., 40° 42′ 46″ N = 40 + 42/60 + 46/3600 = 40.7128°).
  • Sign errors: West longitudes and south latitudes must be entered as negative numbers. Forgetting the minus sign can put you on the other side of the globe.
  • Using the wrong Earth radius: Earth is not a perfect sphere; it is an oblate spheroid. The mean radius of 6,371 km gives an error of up to about 0.5% compared to the more accurate WGS-84 ellipsoid. For most purposes this is acceptable.
  • Antipodal points: The haversine formula handles antipodal points (opposite sides of the Earth) correctly, but due to floating-point precision, the distance may be slightly off (by a few meters). For exact antipodes, the distance is Ï€ × R ≈ 20,015 km.
  • Short distances: For distances under a few hundred meters, the haversine formula can suffer from rounding errors. For such cases, use a local flat-earth approximation or the Vincenty formula.

Alternatives: Vincenty and Flat-Earth Formulas

If you need higher accuracy on Earth’s ellipsoid, the Vincenty formula gives distances accurate to about 0.5 mm. It is an iterative method and can fail for nearly antipodal points. The haversine formula is simpler and always converges, making it the standard for web calculators.

For very short distances (like between two points in a city), you can use the equirectangular approximation:

d = R · √( (Δφ)² + (cos φm · Δλ)² )

where φm is the mean latitude. This is faster and accurate enough for distances under a few kilometers.

Frequently Asked Questions

What is a great circle?

A great circle is the largest circle that can be drawn on a sphere, with its center coinciding with the sphere’s center. The equator and all meridians are great circles. The shortest path between two points on a sphere always lies along a great circle.

Why is the great-circle distance shorter than the straight line on a map?

Maps use projections (like Mercator) that distort distances, especially at high latitudes. On a flat map, a straight line is not the shortest path on the sphere. The great-circle path may appear curved on a standard map, but it is actually the shortest on the globe.

Can I use this calculator for driving or walking directions?

No. This calculator gives the straight-line (as the crow flies) distance over the Earth’s surface. Road, walking, or public transit distances are always longer because they must follow paths and roads. For driving distances, you need a routing service that accounts for the road network.

How do I convert degrees, minutes, seconds to decimal degrees?

Decimal degrees = degrees + minutes/60 + seconds/3600. For south latitudes and west longitudes, make the result negative. For example, 74° 0′ 21.6″ W = −(74 + 0/60 + 21.6/3600) = −74.0060°.

What is the difference between initial bearing and final bearing?

The initial bearing is the direction you start from point 1. The final bearing is the direction you arrive at point 2. Because a great circle is a curve, the bearing changes continuously. The difference between initial and final bearings can be significant for long routes.

Does the calculator account for altitude or terrain?

No. The great-circle distance is on the surface of a sphere at sea level. If you are flying at 10,000 meters altitude, the actual distance traveled is slightly longer (by about 0.15% at that altitude). Terrain (mountains, valleys) does not affect the great-circle distance; it only affects the actual path on the ground.

Practical Tips for Using the Calculator

  • Get coordinates from Google Maps by right-clicking a location and copying the decimal degrees.
  • Double-check that north latitudes and east longitudes are positive, and south and west are negative.
  • For distances in nautical miles, multiply kilometers by 0.53996.
  • If you need the midpoint or waypoints along the great circle, use the formula for intermediate points (not included in this calculator).

Related

Formula used
in lat1 | Latitude of point 1 | ° | 51.5074 | -90
in lon1 | Longitude of point 1 | ° | -0.1278 | -180
in lat2 | Latitude of point 2 | ° | 40.7128 | -90
in lon2 | Longitude of point 2 | ° | -74.0060 | -180
out dist_km | Distance | km | 6371 * 2 * asin(sqrt(sin((lat2-lat1)*pi/360)^2 + cos(lat1*pi/180)*cos(lat2*pi/180)*sin((lon2-lon1)*pi/360)^2)) | 1
out dist_mi | Distance | miles | dist_km * 0.621371 | 1
out bearing | Initial bearing | ° | (atan2(sin((lon2-lon1)*pi/180)*cos(lat2*pi/180), cos(lat1*pi/180)*sin(lat2*pi/180)-sin(lat1*pi/180)*cos(lat2*pi/180)*cos((lon2-lon1)*pi/180)) * 180/pi + 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.