CalcDistance: Calculate Distance Between Two Points

Description Usage Arguments Details Value Author(s) References Examples

View source: R/CalcDistance.R

Description

Calculates the distance between two points on the globe given latitude and longitude in decimal degrees and returning distance in kilometers.

Usage

1
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

1
2
3
##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

TrackReconstruction documentation built on Dec. 11, 2021, 10:07 a.m.