CalcDistance {TrackReconstruction} | R Documentation |
Calculate Distance Between Two Points
Description
Calculates the distance between two points on the globe given latitude and longitude in decimal degrees and returning distance in kilometers.
Usage
CalcDistance(initialLat, initialLong, finalLat, finalLong)
Arguments
initialLat |
initial Latitude |
initialLong |
initial Longitude |
finalLat |
ending Latitude |
finalLong |
ending Longitude |
Details
Data must be provided in decimal degrees (e.g. 162.546). Longitude values west of the prime meridian are 0 to -180.
Latitude values south of the equator are 0 to -90. This function is primarily used internally in the GPStable
and
GeoReference
functions.
Value
Distance in Kilometers
Author(s)
Brian Battaile
References
https://www.movable-type.co.uk/scripts/latlong.html
Examples
##Distance from New York to Los Angeles given Latitude and Longitude of New York and Los Angeles.
Howfar<-CalcDistance(40.7697,-73.9735,34.0522,-118.2428)
Howfar
[Package TrackReconstruction version 1.3 Index]