gcd.hf | R Documentation |
Calculates the geodesic distance between two points specified by their longitude and latitude in degrees calculated using the Haversine formula. This should give accurate results for small and medium distances, but assumes a spherical earth. Algorithms that accurately model an ellipsoid earth are slower, but should be used for long distances.
gcd.hf(long1, lat1, long2, lat2)
long1 |
Longitude of point 1 in degrees. |
lat1 |
Latitude of point 1 in degrees. |
long2 |
Longitude of point 2 in degrees. |
lat2 |
Latitude of point 2 in degrees. |
The distance betwen the two points in kilometers.
Adapted from https://www.r-bloggers.com/great-circle-distance-calculations-in-r/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.