powered by
Calculates the perpendicular point and distance to a line for a series of points.
intersectingPoint(pts, p1 = NULL, p2 = NULL, intercept = NULL, slope = NULL)
A matrix containing columns giving the x and y values of the intersecting point on the line, and the distance to each point.
two element vector or two column matrix of x and y values of points.
two element vectors of two points laying on line.
the intercept and slope of the line.
Eric Archer eric.archer@noaa.gov
pts <- cbind(x = runif(5, 0, 10), y = runif(5, 0, 10)) intersectingPoint(pts, p1 = c(-1, -1), p2 = c(60, 60)) intersectingPoint(pts, intercept = 0, slope = 1)
Run the code above in your browser using DataLab