haversine_distance: Distance between two points on the Earth

View source: R/haversine_distance.R

haversine_distanceR Documentation

Distance between two points on the Earth

Description

Distance between two points on the Earth

Usage

haversine_distance(lat1, lon1, lat2, lon2)

Arguments

lat1, lon1, lat2, lon2

That latitudes and longitudes of the two points.

Details

This is reasonably accurate for distances in the order of 1 to 1000 km.

Value

The distance in kilometres between the two points.

Examples


# Distance from YMEL to YSSY
haversine_distance(-37 - 40/60, 144 + 50/60, -33 - 56/60, 151 + 10/60)


hutils documentation built on April 13, 2022, 5:23 p.m.