Description Usage Arguments Details Arguments details
Distance from a point to a line (so it's the perpendicular distance).
1 | perpendicular.distance(b, m, x, y)
|
b |
Intercept. |
m |
Slope. |
x |
Coordinates. |
y |
Coordinates. |
Find distance from a pt (x then y coords) to a line segment given as start and end points. Either x, y or end points can be vectors, but not both.
It first finds perpendicular distance, then distance to each end point, and returns the minimum.
If both b, m
and x, y
are vectors, they must all be same length.
Note check for infinite slope, meaning that the intercept b is the x-intercept.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.