This function calculates the coordinates of the nearest point on a line to a given point. This function does not work with geographic coordinates.

nearestPointOnLine(coordsLine, coordsPoint)

## Arguments

coordsLine Matrix with coordinates of line vertices. Each row represents a vertex. A vector representing the X and Y coordinates of the point.

## Value

Vector with the X and Y coordinates of the nearest point on a line to the given point.

## Author

German Carrillo

nearestPointOnSegment, snapPointsToLines
coordsLine = cbind(c(1,2,3),c(3,2,2))
#> 1.85 2.15