Skip to contents

Calculates the great-circle distance between two points using the Haversine formula.

Usage

haversine_distance(lat1, lon1, lat2, lon2)

Arguments

lat1, lon1

Coordinates of first point (degrees)

lat2, lon2

Coordinates of second point (degrees)

Value

Distance in kilometers

Examples

# Distance from M6 to M2
haversine_distance(53.07, -15.93, 51.22, -9.99)
#> [1] 454.3435