Learn R Programming

geoprofiler (version 0.0.3)

point_distance: Distance Between Points

Description

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, ...)

Value

units object giving the distance

Arguments

a

lon, lat coordinate of point 1

b

lon, lat coordinate of point 2

...

parameters passed to tectonicr::dist_greatcircle()

Examples

Run this code
berlin <- c(13.4, 52.517) # lon, lat
tokyo <- c(139.767, 35.7) # lon, lat
point_distance(berlin, tokyo)

Run the code above in your browser using DataLab