Estimates the distance on a sphere using lat and long coordinates
spheroid.distance(lat1, lon1 = NULL, lat2 = NULL, lon2 = NULL, bearing = FALSE)
a single value or vector of values representing latitude in decimal degrees from -90 to 90 degrees. Alternatively, a data.frame or matrix can be used here with each column representing lat1, lon1, lat2, lon2 (in that order).
a single value or vector of values representing longitude in decimal degrees from -180 to 180 degrees. If NULL, lat1 is assumed to be a matrix or data.frame.
a single value or vector of values representing latitude in decimal degrees from -90 to 90 degrees. If NULL, lat1 is assumed to be a matrix or data.frame.
a single value or vector of values representing longitude in decimal degrees from -180 to 180 degrees. If NULL, lat1 is assumed to be a matrix or data.frame.
boolean value as to calculate the direction as well as the distance.
Returns a data.frame with:
lon1 - the original longitude
lat1 - the original latitude
lon2 - the destination longitude
lat2 - the destination latitude
distance - the distance used
bearing - if requested, the bearing between the two points
Vincenty, T. (1975). Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of Nested Equations. Survey Review, vol XXII no 176.