Description Usage Arguments Value Note Author(s) References See Also Examples
This is the haversine formula for determining distance between coordinated on a globe.
1 | haversine(xLat, xLon, yLat, yLon)
|
xLat |
Position 1 latitude. |
xLon |
Position 1 longitude. |
yLat |
Position 2 latitude. |
yLon |
Position 2 longitude. |
The output is a list with the coordinates, distance in kilometers and miles.
xLat |
Position 1 latitude. |
xLon |
Position 1 longitude. |
yLat |
Position 2 latitude. |
yLon |
Position 2 longitude. |
distKm |
Distance between points in kilometers. |
distMi |
Distance between points in miles. |
There is some variation between computations due to the measurement used for the Earth's radius. This implementation uses the mean radius measurement of 6371 km versus the equitorial radius of 6378. Feel free to adjust if your opinion differs!
Randall Shane, PhD
rshane@basexvi.com
http://en.wikipedia.org/wiki/Haversine_formula
http://www.movable-type.co.uk/scripts/latlong.html
http://www.platoscave.net/blog/2009/oct/5/calculate-distance-latitude-longitude-python/
degrees2radians
,
geoAddress
,
geoIP
1 | haversine("28.54703","-81.30292","26.93422","-80.09421")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.