Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

arcdist

Calculation of distances along arcs


Description

This function calculates the shortest arc distance between two points.

Usage

arcdist(p1, p2, output = "distance", origin = c(0, 0, 0), radius = authRadius)

Arguments

p1

(numeric) Vector, XYZ or longitude-latitude coordinates of the first point along the arc.

p2

(numeric) Vector, XYZ or longitude-latitude coordinates of the last point along the arc.

output

(character) The type of the output value. "distance" will give the distance in the metric that was fed to the function for the coordinates or the radius. "deg" will output the the distance in degrees, "rad" will do so in radians.

origin

(numeric) Vector, the center of the circle in XYZ coordinates (default is c(0,0,0)).

radius

(numeric) The radius of the circle in case the input points have polar coordinates only. Unused when XYZ coordinates are entered. Defaults to the authalic radius of Earth ca. 6371.007km.

Value

A single numeric value.

Examples

# coordinates of two points
point1<- c(0,0)
point2<- c(180,0)
arcdist(point1,point2,"distance")

icosa

Global Triangular and Penta-Hexagonal Grids Based on Tessellated Icosahedra

v0.10.1
GPL-3
Authors
Adam T. Kocsis [aut, cre]
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.