haversine | R Documentation |
Calculates the shortest distance between two points on the Earth's surface using the Haversine formula, also known as the great-circle distance or "as the crow flies".
haversine(lat_from, lon_from, lat_to, lon_to, r = 6378137)
lat_from |
Latitude of the starting point. |
lon_from |
Longitude of the starting point. |
lat_to |
Latitude of the destination point. |
lon_to |
Longitude of the destination point. |
r |
Radius of the Earth in meters (default = 6378137). |
The Haversine ('half-versed-sine') formula was published by R.W. Sinnott in 1984, although it has been known for much longer.
Vector of distances in the same unit as r
(default in meters).
Martin Haringa
Sinnott, R.W, 1984. Virtues of the Haversine. Sky and Telescope 68(2): 159.
haversine(53.24007, 6.520386, 53.24054, 6.520386)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.