Read · 1 min

The shortest distance from a point (x0,y0)(x_0, y_0) to a line (ax+by+c=0)(ax+by+c=0) is essentially the length of the line segment that connects the point and line, and is perpendicular to the line.

In this case, what is the distance of the shortest distance?

(The following will be an algebraic proof of the formula, which only works when we assume that the aa and bb are not equal to 00)

The line (ax+by+c=0)(ax+by+c=0) has slope −ab\dfrac{-a}{b}. Thus, any perpendicular line of ax+by+c=0ax+by+c=0 has the slope ba\dfrac{b}{a}.

Let (m,n)(m, n) be the point of intersection between the perpendicular line (which also passes through (x0,y0)(x_0, y_0) and the original line ax+by+c=0ax+by+c=0.

y0−nx0−m=ba\dfrac{y_0-n}{x_0-m}=\dfrac{b}{a}

a(y0−n)−b(x0−m)=0a(y_0-n)-b(x_0-m)=0 Square both sides.

a2(y0−n)2+b2(x0−m)2=2ab(y0−n)(x0−m)a^2(y_0-n)^2+b^2(x_0-m)^2=2ab(y_0-n)(x_0-m)

Before going on, look at this:

(a(x0−m)+b(y0−n))2(a(x_0 - m) + b(y_0 - n))^2

==

a2(x0−m)2+2ab(y0−n)(x0−m)+b2(y0−n)2a^2(x_0 - m)^2 + 2ab(y_0 -n)(x_0 - m) + b^2(y_0 - n)^2

==

(a2+b2)((x0−m)2+(y0−n)2)(a^2 + b^2)((x_0 - m)^2 + (y_0 - n)^2)

We also have

(a(x0−m)+b(y0−n))2(a(x_0 - m) + b(y_0 - n))^2

==

(ax0+by0−am−bn)2(ax_0 + by_0 - am -bn )^2

==

(ax0+by0+c)2(ax_0 + by_0 + c)^2

This is because (m,n)(m, n) is on line ax+by+c=0ax+by+c=0

Thus,

(a2+b2)((x0−m)2+(y0−n)2)=(ax0+by0+c)2(a^2 + b^2)((x_0 - m)^2 + (y_0 - n)^2) = (ax_0 + by_0 + c)^2

Now use the distance formula to obtain the length of the line segment obtained by these two points.

d=x(x0−m)2+(y0−n)2d=\sqrt{x(x_0-m)^2+(y_0-n)^2}

=∣ax0+by0+c∣a2+b2=\dfrac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}

And the above is the formula for the shortest distance from a point to a line!

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems