Calculate distance, bearing and more between two latitude/longitude points
Distance
This page helps you to calculate great-circle distances between two points using the ‘Haversine’ formula.
The formula assumes that the earth is a sphere, (we know that it is "egg" shaped) but it is accurate enough* for our purposes.
Enter the coordinates into the text boxes to try it out. It accepts a variety of formats:
deg-min-sec suffixed with N/S/E/W (e.g. 40°44′55″N, 73 59 11W), or
signed decimal degrees without compass direction, where negative indicates west/south (e.g. 40.7486, -73.9864)
And you can see it on a map (thanks to Google Maps)
Haversine formula:
R = earth’s radius (mean radius = 6,371km)
Δlat = lat2− lat1
Δlong = long2− long1
a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2)
c = 2.atan2(√a, √(1−a))
d = R.c
(Note that angles need to be in radians to pass to trig functions).
The Haversine formula remains particularly well-conditioned for numerical computation even at small distances
Spherical law
of cosines: d = acos(sin(lat1).sin(lat2)+cos(lat1).cos(lat2).cos(long2−long1)).R
Excel:
=ACOS(SIN(Lat1)*SIN(Lat2)+COS(Lat1)*COS(Lat2)*COS(Lon2-Lon1))*6371