earthDist | R Documentation |
earthDist
calculates distance (in kilometers) between two
lon/lat positions.
The function assumes a mean equatorial Earth radius of 6378.145 km. One of the
lon/lat positions (i.e. lon1 and lat1) can be a vector of positions to compare against
the other lon/lat position (i.e. lon2 and lat2)
earthDist(lon1, lat1, lon2, lat2)
lon1 |
Longitude 1 (in decimal degrees) |
lat1 |
Latitude 1 (in decimal degrees) |
lon2 |
Longitude 2 (in decimal degrees) |
lat2 |
Latitude 2 (in decimal degrees) |
Vector of distances (km)
earthDist(0,0,20,20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.