powered by
This function calculates the distance of two points in a grid.
getDistance(point.a, point.b, resolution=1)
A point in a grid given by its row and column.
The resolution of the grid in (geographical) degree.
The distance of the two points as an numeric value based on geographical degrees.
This function calculates the distance of two points in a grid by the Pythagorean theorem.
# NOT RUN { ##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) # }
Run the code above in your browser using DataLab