Toolbox runs in your browser

Index / Science

Great-Circle Distance

Two coordinates into a distance and a bearing, worked out twice: once on a sphere with the haversine formula, and once on the WGS-84 ellipsoid with Vincenty's. The difference between the two is printed, because on a long path it is kilometres.

From
51.4775, 51°28'39"N and 51 28 39 N all read the same. South is negative.
West is negative.
To
Distance on the ellipsoid
--

Initial bearing --
Sphere against ellipsoid --

The two answers, and the units

Direction

a great circle turns as you fly it

The points

as read
Which Earth each number is about The haversine distance is on a sphere of radius 6,371.0088 km, the IUGG mean radius. It is the number most calculators give, it is two lines of trigonometry, and on a long path it can be out by half a percent — 25 km on a flight from London to Sydney. The formula is stable for short distances, which the older cosine rule is not.

The Vincenty distance is on the WGS-84 ellipsoid, with a = 6,378,137 m and flattening f = 1/298.257223563 exactly — the figures GPS uses. It iterates until λ moves by less than 10−12 radians, which is about 0.06 mm on the ground, and it is accurate to about half a millimetre.

Vincenty's method does not converge for nearly antipodal points. That is a property of the method, not a bug in this page: the iteration oscillates when the two points are almost exactly opposite each other. When it happens the page says so and falls back to the spherical answer rather than printing whatever the last iteration held.

The initial and final bearings are different numbers. A great circle is not a line of constant heading: leaving London for New York you set off around 288° and arrive heading about 236°. Both are printed. The rhumb line is the path you get by holding one heading — simpler to steer, longer to fly, and printed here for comparison.

Distances are along the surface at sea level. No terrain, no altitude, no atmosphere. A flight is longer than any of these because it is routed; a tunnel is shorter, and the straight chord through the Earth is printed for that reason.

A nautical mile is exactly 1,852 m by definition, which is why one minute of latitude is almost exactly one nautical mile — the definition was chosen to make it so, and the ellipsoid then makes it approximate again. A statute mile is exactly 1,609.344 m.

Coordinates are read as WGS-84 degrees. A coordinate from an old map on a national datum can be tens or hundreds of metres away from the same-looking WGS-84 coordinate, and no arithmetic on this page can tell the difference.