Skip to contents

This uses the haversine formula (by default) to calculate the great-circle distance between two points, i.e., the shortest distance over the earth's surface.

Usage

point_distance(a, b, ...)

Arguments

a

lon, lat coordinate of point 1

b

lon, lat coordinate of point 2

...

parameters passed to tectonicr::dist_greatcircle()

Value

units object giving the distance

Examples

berlin <- c(52.517, 13.4)
tokyo <- c(35.7, 139.767)
point_distance(berlin, tokyo)
#> 247.3829 [km]