Point-Line Distance

The distance of a point $(x',y')$ from a straight line (line-point distance), understood as orthogonal distance, that is, the distance between the given point and the closest point on the line, is given by:

\begin{displaymath}
d = \frac{\vert a x' + b y' + c \vert}{ \sqrt{a^2 + b^2} }
\end{displaymath} (1.31)

In the n-dimensional case, the point $\mathbf {x}$ on the line described by equation (1.22) that is closest to a point $\mathbf{m}$ is the point for which the scalar $t$ assumes the value

\begin{displaymath}
t = (\mathbf{m} - \mathbf{p}) \cdot \mathbf{v}
\end{displaymath} (1.32)

scalar projection onto the direction $\mathbf{v}$ of the segment $\mathbf{m}-\mathbf{p}$.

This version becomes very interesting when measuring the distance between a point $\mathbf{m}$ and a segment $(\mathbf{p},\mathbf{q})$ utilizing the line generated as in equation (1.29). In this case, a value of $t$ between $[0,1]$ indicates that the closest point to $\mathbf{m}$ lies within the segment, as the scalar projection of segment $(\mathbf{p},\mathbf{m})$ onto segment $(\mathbf{p},\mathbf{q})$.

Finally, in section 1.5.10, in equation (1.54), it will be shown how to find the point on a hyperplane that is closest to a generic point. This formulation can also be applied to lines expressed in hyperplane form, and consequently, the point $(x,y)$ on line $(a,b,c)$ that is closest to point $(x',y')$ is

\begin{displaymath}
(x,y) = \left( x' - a \frac{a x' + b y' + c}{a^2+b^2}, y' - b \frac{a x' + b y' + c}{a^2+b^2} \right)
\end{displaymath} (1.33)

Paolo medici
2025-10-22