View source: R/spheroid_dist.R
spheroid_dist | R Documentation |
Calculate the distance between two points on the surface of a spheroid using Vincenty's formula. This function can be used when GIS libraries for calculating distance are not available.
spheroid_dist(p1, p2)
p1 |
coordinates of the first point in decimal degrees (LON, LAT) |
p2 |
coordinates of the second point in decimal degrees (LON, LAT) |
numerical vector with distance between two locations (in kilometers)
p1 = c(18.633333, 54.366667) # longitude and latitude for Gdansk, PL
p2 = c(17.016667, 54.466667) # longitude and latitude for Slupsk, PL
spheroid_dist(p1, p2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.