spheroid_dist: Distance between two points on a spheroid

View source: R/spheroid_dist.R

spheroid_distR Documentation

Distance between two points on a spheroid

Description

Calculate the distance between two points on the surface of a spheroid using Vincenty's formula. This function can be used when GIS libraries for calculating distance are not available.

Usage

spheroid_dist(p1, p2)

Arguments

p1

coordinates of the first point in decimal degrees (LON, LAT)

p2

coordinates of the second point in decimal degrees (LON, LAT)

Value

distance between two locations in kilometers

Examples

 p1 = c(18.633333, 54.366667) # longitude and latitude for Gdansk
 p2 = c(17.016667, 54.466667) # longitude and latitude for Slupsk
 spheroid_dist(p1, p2)
 

climate documentation built on Aug. 9, 2022, 5:08 p.m.