gcd.slc: Distance based on spherical law of cosines

View source: R/gcd.slc.R

gcd.slcR Documentation

Distance based on spherical law of cosines

Description

Calculates the geodesic distance between two points (or multiple pairs of points) specified by radian latitude/longitude.

Usage

gcd.slc(long1, lat1, long2, lat2)

Arguments

long1

longitude(s) in radians, vector of one or more numbers

lat1

latitude(s) in radians, vector of one or more numbers

long2

longitude(s) in radians, vector of one or more numbers

lat2

latitude(s) in radians, vector of one or more numbers

Details

long1 and lat1 must be same length. long2 and lat1 must be same length. All four must be the same length, defining pairs of points. Alternatively long1 and lat1 can define a single point while long2 and lat2 define a series of points, or vice versa. Taken from http://www.r-bloggers.com/great-circle-distance-calculations-in-r/ but use pmin instead of min to vectorize it to handle at least pairs.

Value

Distance in kilometers

See Also

convert, gcd, get.distances, get.distances.all


ejanalysis/proxistat documentation built on April 2, 2024, 10:13 a.m.