What is easiest way to find the a point on a line $(a1, b1)$, $(a2, b2)$ or the extension of the line, which is nearest to a point $(x1, y1)$.
Nearest point on the line or its extension from a point
-
0See [this old thread](http://math.stackexchange.com/questions/62633/orthogonal-projection-of-a-point-onto-a-line) for a worked example, which shouldn't be too hard to generalize. – 2011-12-26
2 Answers
The points on the line containing $(a_1,b_1),(a_2,b_2)$ are given by $(a_1,b_1) + t
At the nearest point, the angle that the line between $x_1x_2$ and $(?_1,?_2)$ makes with the line through $a_1b_1$ is 90. So its gradient is $\frac{-1}{g}$ if g is the gradient of the given line. Now make this line go through $(x_1,x_2)$ and find the intersection with the line through $(a_1,b_1)$.