Learn R Programming

graph4lg (version 1.6.0)

dist_gc_hvs: Calculate the Great-Circle distance between two points using the Harversine formula (hvs)

Description

The function calculates the Great-Circle distance between two points specified by radian latitude/longitude using the Harversine formula (hvs)

Usage

dist_gc_hvs(long1, lat1, long2, lat2)

Arguments

long1

Point 1 longitude in radians

lat1

Point 1 latitude in radians

long2

Point 2 longitude in radians

lat2

Point 2 latitude in radians

Value

The distance between points 1 and 2 in meters

Examples

Run this code
# NOT RUN {
dist_gc_hvs(long1 = -73.99420, lat1 = 40.75170,
            long2 = -87.63940, lat2 = 41.87440)
# }

Run the code above in your browser using DataLab