earthDist: Earth distance between two geographic locations

earthDistR Documentation

Earth distance between two geographic locations

Description

earthDist calculates distance (in kilometers) between two lon/lat positions. The function assumes a mean equatorial Earth radius of 6378.145 km. One of the lon/lat positions (i.e. lon1 and lat1) can be a vector of positions to compare against the other lon/lat position (i.e. lon2 and lat2)

Usage

earthDist(lon1, lat1, lon2, lat2)

Arguments

lon1

Longitude 1 (in decimal degrees)

lat1

Latitude 1 (in decimal degrees)

lon2

Longitude 2 (in decimal degrees)

lat2

Latitude 2 (in decimal degrees)

Value

Vector of distances (km)

Examples

earthDist(0,0,20,20)


marchtaylor/sinkr documentation built on July 4, 2022, 5:48 p.m.