getDistance {sperich} | R Documentation |
Distance between two points in a grid
Description
This function calculates the distance of two points in a grid.
Usage
getDistance(point.a, point.b, resolution=1)
Arguments
point.a |
A point in a grid given by its row and column. |
point.b |
A point in a grid given by its row and column. |
resolution |
The resolution of the grid in (geographical) degree. |
Details
This function calculates the distance of two points in a grid by the Pythagorean theorem.
Value
The distance of the two points as an numeric value based on geographical degrees.
Author(s)
Maximilian Lange, Sven Lautenbach
Examples
##initialize data
point.a <- c(5,8)
point.b <- c(10,3)
##calculate the distance of the two points
distance <- getDistance(point.a,point.b, resolution=1)
print(distance)
[Package sperich version 1.5-9 Index]