Description Usage Arguments Details Value Note Author(s) References See Also Examples
Find the the point on a line segment (x1,y1) (x2,y2) that is closest to point (px,py).
1 | ClosestPoint(px, py, x1, y1, x2, y2)
|
px |
x coordinate of point |
py |
y coordinate of point |
x1 |
x coordinate of one end of a segment |
y1 |
y coordinate of one end of a segment |
x2 |
x coordenite of other end of a segment |
y2 |
y coordinate of other end of a segment |
This function finds the the point on a line segment (x1,y1) (x2,y2) that is closest to point (px,py). If the line perpendicular to the line segment does not intersect the segment, the function will return an end point of the segment, otherwise, it will return a point on the line segment where the perpendicular line intersects the segment.
a point-pair (x,y)
Uses LineMagnitude, also supplied by the pathmapping package.
Shane T. Mueller and Brandon Perelman
See Mueller et al., (2016). https://sites.google.com/a/mtu.edu/mapping/
LineMagnitude
, DistancePointSegment
1 2 3 | ClosestPoint(1,10,2,0,5,0) #returns end point 2 0
ClosestPoint(20,10,2,0,5,0) #returns other end point 5 0
ClosestPoint(4.5,10,2,0,5,0) #returns closest point 4.5 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.