﻿ Shortest Distance from a Point to a Line

Shortest Distance from a Point to a Line

Intuitively, it makes sense that the shortest distance between two points is a straight line. When dealing with a point and a line, the shortest distance turns out to be a perpendicular line. See the figure to the left.

It is evident from the picture that the shortest line connecting the black line and the point is the green line. It forms a right angle with the black line. With this fact established, we turn out attention to the problem of finding the shortest distance.

Suppose we are given an arbitrary line in the form y = mx + b and a point P(x1, y1). We want to find the shortest distance between the line and the point. We shall call the point on the line that is shortest (x0, y0). We have drawn a green line between the point and line. We want to find the length of that green line. (See the figure below.)

Notice that the equations of both lines have been included. The first equation was given to us. The second was found using the fact that the slope of the line perpendicular to another line with slope m will be 1/m. The y-intercept was found by plugging in the point (x1, y1) and solving for b.

Now, we want to find the point where the two lines intersect. We know that at that point, the two lines intersect, so we shall set them equal to each other and solve for x. Then we will take that x-value and plug it into the first line, thereby solving for y. That will give us the point (x0, y0).

Setting the two lines equal to each other, we have . Adding and subtracting terms, we get that:

Now that we know x0, we can find plug that into the line y = mx + b to solve for y0. Doing this, we see that

Now, we want to find the distance between the points (x0, y0) and (x1, y1). And so, we use the distance formula.

And so, the distance between the point (x1, y1) and the line y = mx + b is given by the formula: .

An alternative form that is often used is , where instead of the line y = mx + b, we have the equation Ax + By + C = 0. If we convert this formula into the standard slope-intercept form, we have . And we see that m corresponds with  and that b corresponds with .

Going back to our formula and replacing m and b, we have:

.

That is precisely the formula that we wanted to show, and so we are done.