Learn R Programming

h3r (version 0.1.2)

greatCircleDistanceRads: Great Circle Distance In Radians

Description

Gives the "great circle" or "haversine" distance between pairs of lat/lng coordinates in radians

Usage

greatCircleDistanceRads(aLat, aLng, bLat, bLng)

Value

numeric vector giving the great circle distance in radians

Arguments

aLat

vector of latitude cooridnates (from)

aLng

vector of longitude coordinates (from)

bLat

vector of latitude coordinates (to)

bLng

vector of longitude coordinates (to)

Examples

Run this code

greatCircleDistanceRads(
  aLat = c(-37.820197)
  , aLng = c(144.983324)
  , bLat = c(-37.818476)
  , bLng = c(144.967354)
)

Run the code above in your browser using DataLab