distSeg: Computes distances between the top coordinates of segments.
Description
Computes the distances between the top coordinates of segments.
Usage
distSeg(mydata,decdeg=FALSE)
Arguments
mydata
A matrix or data frame of 4 columns giving the coordinates of each segment tops x1, y1, x2, y2
decdeg
TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in meters
Value
A vector of distances
Details
If degdec is FALSE (default), distance computed is Euclidian. Units depends on the coordinate systems.
If decdeg = TRUE, D = 1852 * 60 * (180/pi) * acos ( sin(la1) * sin(la2) + cos(la1) * cos(la2) * cos(abs(lg1 - lg2)).
This method calculates the great circle distance, is based on spherical trigonometry, and assumes that: