gcd.hf: Geosedic distance between two points.

View source: R/misc.R

gcd.hfR Documentation

Geosedic distance between two points.

Description

Calculates the geodesic distance between two points specified by their longitude and latitude in degrees calculated using the Haversine formula. This should give accurate results for small and medium distances, but assumes a spherical earth. Algorithms that accurately model an ellipsoid earth are slower, but should be used for long distances.

Usage

gcd.hf(long1, lat1, long2, lat2)

Arguments

long1

Longitude of point 1 in degrees.

lat1

Latitude of point 1 in degrees.

long2

Longitude of point 2 in degrees.

lat2

Latitude of point 2 in degrees.

Value

The distance betwen the two points in kilometers.

Source

Adapted from https://www.r-bloggers.com/great-circle-distance-calculations-in-r/


LukasWallrich/rNuggets documentation built on Aug. 26, 2022, 11:03 a.m.