MathLabs
TheoremProved

Point-to-Line Distance Formula

Statement

The perpendicular distance from a point M0(x0,y0)M_0(x_0,y_0) to a line Δ:ax+by+c=0\Delta: ax+by+c=0 (with a2+b2>0a^2+b^2>0) is d(M0,Δ)=∣ax0+by0+c∣a2+b2d(M_0,\Delta)=\dfrac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}.

Why is it true?

The shortest segment from M0M_0 to Δ\Delta runs along the normal direction n⃗=(a,b)\vec{n}=(a,b), so projecting the vector from any point on Δ\Delta to M0M_0 onto the unit normal n⃗∣n⃗∣\dfrac{\vec{n}}{|\vec{n}|} measures the exact perpendicular distance.

Proof sketch

Let H(xH,yH)H(x_H,y_H) be the orthogonal projection of M0(x0,y0)M_0(x_0,y_0) onto Δ\Delta. Because HM0→\overrightarrow{HM_0} is parallel to the normal vector n⃗=(a,b)\vec{n}=(a,b), there exists a scalar t∈Rt\in\mathbb{R} such that HM0→=tn⃗=(ta,tb)\overrightarrow{HM_0}=t\vec{n}=(ta,tb), which gives xH=x0−tax_H=x_0-ta and yH=y0−tby_H=y_0-tb.

Since HH lies on Δ\Delta, its coordinates satisfy axH+byH+c=0ax_H+by_H+c=0. Substituting xHx_H and yHy_H yields a(x0−ta)+b(y0−tb)+c=0a(x_0-ta)+b(y_0-tb)+c=0, or ax0+by0+c−t(a2+b2)=0ax_0+by_0+c-t(a^2+b^2)=0.

Solving for tt gives t=ax0+by0+ca2+b2t=\dfrac{ax_0+by_0+c}{a^2+b^2}. Therefore the distance is d(M0,Δ)=∣HM0→∣=∣t∣ ∣n⃗∣=∣ax0+by0+c∣a2+b2a2+b2=∣ax0+by0+c∣a2+b2d(M_0,\Delta)=|\overrightarrow{HM_0}|=|t|\,|\vec{n}|=\dfrac{|ax_0+by_0+c|}{a^2+b^2}\sqrt{a^2+b^2}=\dfrac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. René Descartes (trans. David Eugene Smith, Marcia L. Latham) (1954). The Geometry of René Descartes
  2. H. S. M. Coxeter (1969). Introduction to Geometry