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.
Arguments
- p1
coordinates of the first point in decimal degrees (LON, LAT)
- p2
coordinates of the second point in decimal degrees (LON, LAT)
Value
numerical vector with distance between two locations (in kilometers)
Examples
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)
#> [1] 105.19