For all intents and purposes this concept is an asked and answered question on this site. However, my question about this topic is much more to do with the general vector approach to solving this question. Not to mention, I could not quite follow the explanations here and here. This should be a rather trivial problem to solve, but it's driving me nuts.
Let $l = [a,b,1]$ be a normal vector defining a line such that $ax + by + 1 = 0$.
Let $p = [x_1,y_1,1]$ be a point on the same plane ($z = 1$).
I want to find the point $q = [x_2, y_2, 1]$ that minimizes the distance between $p$ and $q$. More formally:
$\underset{q} argmin ||p-q||_2$ subject to $l \cdot q = 0$.
I know that $q \cdot (p-q) = 0$ because the shortest line is perpendicular to the line $l$. I also know that $l \cdot q = 0$ because the point $q$ falls on the line $l$. What I cannot seem to grasp is how to find the components $x_2$ and $y_2$ of $q$.
Can someone please help me out?
Thanks in advance!