great_circle_dist: Great circle distance

Description Usage Arguments Details Value Examples

View source: R/distance.R

Description

Calculate the distance between two points as great circle distance on the globe

Usage

1

Arguments

x1

coordinate pair 1, as list with $lat and $lon

x2

coordinate pair 2, as list with $lat and $lon

Details

Uses information from http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates, where dist = arccos(sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon1 - lon2)) * R

Value

The distance on the globe in kilometers.

Examples

1
2
great_circle_dist(list(lon = 0.3, lat = 40.91), list(lon = 1.3,
lat = 41.02))

cszang/histalp documentation built on May 14, 2019, 12:26 p.m.