util.distPointLineSeg | R Documentation |
The function projects the point onto the line and returns the perpendicular distance between the point and the line if the projection fall within the line segment. If the projection falls outside the line segments it returns the closest distance between the point and the closest end segment point
util.distPointLineSeg(xp, yp, x1, y1, x2, y2)
xp |
the x coordinate of the point |
yp |
the y coordinate of the point |
x1 |
the x coordinate of the end point of the line |
y1 |
the y coordinate of the end point of the line |
x2 |
the x coordinate of the other end point of the line |
y2 |
the y coordinate of the other end point of the line |
the closest distance between the point and the line segment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.