Enrichment · Passion Projects · Maps
Type places by latitude and longitude. The calculator gives the distance and starting bearing of every leg over the curved Earth, the total along the route and the straight line from start to finish.
The worked example is a made-up drive between four cities on a college visit trip. Nothing you type leaves this browser.
Loading the calculator. If nothing appears, turn on JavaScript.
Decimal degrees: north and east are positive, south and west negative (Chicago is 41.8781, −87.6298).
Two or more. Each leg runs from one line to the next.
Enrichment · Passion ProjectsFree
The haversine formula on a round Earth.
Latitudes φ and longitudes λ are turned into radians. a = sin²(Δφ ÷ 2) + cos φ₁ × cos φ₂ × sin²(Δλ ÷ 2), and the central angle is 2 × asin(√a). Multiplied by the Earth's mean radius, 6,371.0088 km, it is the shortest distance over the surface. The starting bearing is atan2(sin Δλ cos φ₂, cos φ₁ sin φ₂ − sin φ₁ cos φ₂ cos Δλ).
The Earth is slightly flattened, so a sphere is off by up to about 0.5%, a few miles on a long leg; surveyors use ellipsoid formulas for that last bit. A great circle is not a constant compass heading, which is why flights from the United States to Europe arc north. Road distances are longer still.
The worked example is made up. Distances are over the Earth's surface, not by road. Your places stay in this browser. Support: team@caveatacademic.com.