I can't seem to find any definitive answer to this question.
Assuming I have a 2D line in homogeneous coordinates defined by $$l = (a, b, c)^T$$ and a point in 2D space, $$x = (x, y)^T,$$ how do I find the perpendicular distance between the two.
I know it has something to do with the dot product, but I can't remember exactly how it works. It would be nice if you could walk me through why your answer is correct.
$x^Tl=0$ is line fomula where $(l_1,l_2)^T$ is the normal and $l_3$ is the y offset at $x=0$ of the line.
For computing the distance, we shift the whole graph by the offset and compute the scalar product of the normalized normal of the line with the shifted point.
The normalized normal of the line is $n=\frac{\begin{pmatrix} l_1 \\ l_2 \end{pmatrix}}{\sqrt{l_1^2+l_2^2}}$. Finally $d = \frac{\left(\begin{pmatrix} x\\ y\end{pmatrix}-\begin{pmatrix} 0\\ -l_3/l_2\end{pmatrix}\right)^T\begin{pmatrix} l_1\\ l_2\end{pmatrix}}{\sqrt{l_1^2+l_2^2}}$ which results to the result given previously. The sign depends on which side the point x from the line l, therefore you can take the absolute value.