Lesson Explainer: Perpendicular Distance from a Point to a Line on the Coordinate Plane Mathematics

In this explainer, we will learn how to find the perpendicular distance between a point and a straight line or between two parallel lines on the coordinate plane using the formula.

By using the Pythagorean theorem, we can find a formula for the distance between any two points in the plane. For example, to find the distance between the points (π‘₯,𝑦) and (π‘₯,𝑦), we can construct the following right triangle.

Since the distance between these points is the hypotenuse of this right triangle, we can find this distance by applying the Pythagorean theorem.

Recap: Distance between Two Points in Two Dimensions

The distance, 𝐷, between the points (π‘₯,𝑦) and (π‘₯,𝑦) is given by 𝐷=(π‘₯βˆ’π‘₯)+(π‘¦βˆ’π‘¦).

This formula tells us the distance between any two points. We can use this to determine the distance between a point and a line in two-dimensional space. We want this to be the shortest distance between the line and the point, so we will start by determining what the shortest distance between a point and a line is. To do this, we will first consider the distance between an arbitrary point 𝐴 on a line 𝐿 and a point 𝑃, as shown in the following diagram.

First, if 𝑃 lies on line 𝐿, then the distance will be zero, so let’s assume that this is not the case. We could find the distance between 𝑃 and 𝐴 by using the formula for the distance between two points. However, we do not know which point on the line gives us the shortest distance. We can find a shorter distance by constructing the following right triangle.

Since 𝑃𝐴 is the hypotenuse of the right triangle 𝑃𝑄𝐴, it is longer than 𝑃𝑄. The same will be true for any point on line 𝐿, which means that the length of 𝑃𝑄 is the shortest distance between any point on line 𝐿 and point 𝑃. We call this the perpendicular distance between point 𝑃 and line 𝐿 because 𝑃𝑄 and 𝐿 are perpendicular. We are now ready to find the shortest distance between a point and a line.

How To: Identifying and Finding the Shortest Distance between a Point and a Line

We want to find the shortest distance between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0, where both π‘Ž and 𝑏 cannot both be equal to zero. If 𝐿 is vertical or horizontal, then the distance is just the horizontal/vertical distance, so we can also assume this is not the case. If 𝑃 lies on line 𝐿, then the distance will be zero, so let’s assume that this is not the case.

We know the shortest distance between the line and the point is the perpendicular distance, so we will draw this perpendicular and label the point of intersection 𝑄. There are a few options for finding this distance. For example, since the line between 𝑃 and 𝑄 is perpendicular to 𝐿, we could find the equation of the line passing through 𝑃 and 𝑄 to find the coordinates of 𝑄. However, we will use a different method. We start by dropping a vertical line from point 𝑃 to 𝐿. We call the point of intersection 𝑅, which has coordinates (π‘₯,𝑦).

We can find the shortest distance between a point and a line by finding the coordinates of 𝑄 and then applying the formula for the distance between two points.

We start by denoting the perpendicular distance 𝐷. To find the length of 𝑃𝑄, we will construct, anywhere on line 𝐿, a right triangle with legs parallel to the π‘₯- and 𝑦-axes. Using the fact that 𝐿 has a slope of βˆ’π‘Žπ‘, we can draw this triangle such that the lengths of its sides are |𝑏| and |π‘Ž|, as shown in the following diagram.

We can show that these two triangles are similar. Notice that 𝑃𝑅 and π‘‡π‘ˆ are vertical lines, so they are parallel, and we note that they intersect the same line 𝐿.This tells us π‘šβˆ π‘ƒπ‘…π‘„=π‘šβˆ π‘‡π‘ˆπ‘† because they are corresponding angles. We know that both triangles are right triangles and so the final angles in each triangle must also be equal. Hence, these two triangles are similar, in particular, β–³π‘ƒπ‘„π‘…βˆΌβ–³π‘†π‘‡π‘ˆ, giving us the following diagram.

The ratio of the corresponding side lengths in similar triangles are equal, so 𝑃𝑄𝑆𝑇=π‘ƒπ‘…π‘†π‘ˆ.

The distance between 𝑃 and 𝑅 is the absolute value of the difference in their 𝑦-coordinates: 𝑃𝑅=|π‘¦βˆ’π‘¦|.

We also have 𝑃𝑄=𝐷,𝑆𝑇=|𝑏|,π‘†π‘ˆ=βˆšπ‘Ž+𝑏.

Substituting these into the ratio equation gives 𝐷|𝑏|=|π‘¦βˆ’π‘¦|βˆšπ‘Ž+𝑏.

And then rearranging gives us 𝐷=|𝑏||π‘¦βˆ’π‘¦|βˆšπ‘Ž+𝑏.

We want to find an expression for 𝐷 in terms of the coordinates of 𝑃 and the equation of line 𝐿. We can do this by recalling that point 𝑅(π‘₯,𝑦) lies on line 𝐿, so it satisfies the equation π‘Žπ‘₯+𝑏𝑦+𝑐=0𝑦=βˆ’π‘Žπ‘₯βˆ’π‘π‘.

Substituting this into our equation for 𝐷 and simplifying gives 𝐷=|𝑏|||π‘¦βˆ’ο€»ο‡||||βˆšπ‘Ž+𝑏||=|𝑏𝑦+π‘Žπ‘₯+𝑐|βˆšπ‘Ž+𝑏.οŠ§οŠ±οŒΊο—οŠ±οŒΌοŒ»οŠ¨οŠ¨οŠ§οŠ§οŠ¨οŠ¨οŽ 

Hence, 𝐷=|𝑏𝑦+π‘Žπ‘₯+𝑐|βˆšπ‘Ž+𝑏.

Before we summarize this result, it is worth noting that this formula also holds if line 𝐿 is vertical or horizontal. If 𝐿 is vertical, then the perpendicular distance between 𝐿: π‘Žπ‘₯=βˆ’π‘ and 𝑃(π‘₯,𝑦) is the absolute value of the difference in their π‘₯-coordinates: 𝐷=||π‘₯+π‘π‘Ž||.

To apply the formula, we would see π‘Ž=π‘Ž, 𝑏=0, and 𝑐=𝑐, giving us 𝐷=|0𝑦+π‘Žπ‘₯+𝑐|βˆšπ‘Ž+0=|π‘Žπ‘₯+𝑐||π‘Ž|=||π‘₯+π‘π‘Ž||.

Since these expressions are equal, the formula also holds if 𝐿 is vertical. We could do the same if 𝐿 was horizontal. This gives us the following result.

Theorem: The Shortest Distance between a Point and a Line in Two Dimensions

The shortest distance (or the perpendicular distance), 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

We also refer to the formula above as the distance between a point and a line. Let’s see an example of how we can apply this formula to find the distance between a point and a line given in general form.

Example 1: Finding the Distance between a Point and a Straight Line in Two Dimensions

Find the length of the perpendicular drawn from the point 𝐴(1,9) to the straight line βˆ’5π‘₯+12𝑦+13=0.

Answer

We recall that the perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

From the coordinates of 𝐴, we have π‘₯=1 and 𝑦=9. From the equation of 𝐿, we have π‘Ž=βˆ’5, 𝑏=12, and 𝑐=13. Substituting these values into the formula and evaluating yields 𝐷=|βˆ’5(1)+12(9)+13|(βˆ’5)+12=|116|√169=11613.

Therefore, the distance from point 𝐴(1,9) to the straight line βˆ’5π‘₯+12𝑦+13=0 is 11613 length units.

In our next example, we will see how to apply this formula if the line is given in vector form.

Example 2: Finding the Distance between a Point and a Straight Line Given in Vector Form in Two Dimensions

Find the length of the perpendicular from the point (5,7) to the straight line βƒ‘π‘Ÿ=(βˆ’7,6)+𝑠(βˆ’5,7).

Answer

We want to find the perpendicular distance between a point and a line. To do this, we will start by recalling the following formula.

The perpendicular distance, 𝐷, between (π‘₯,𝑦) and 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

In this question, we are not given the equation of our line in the general form. Instead, we are given the vector form of the equation of a line. To apply our formula, we first need to convert the vector form into the general form.

We recall that the equation of a line passing through (π‘₯,𝑦) and of slope π‘š is given by the point–slope form π‘¦βˆ’π‘¦=π‘š(π‘₯βˆ’π‘₯).

Since we can rearrange this equation into the general form, we start by finding a point on the line and its slope. In the vector form of a line, βƒ‘π‘Ÿ=βƒ‘π‘Ž+𝑠⃑𝑑, βƒ‘π‘Ž is the position vector of a point on the line, so (βˆ’7,6) lies on our line.

So, we can set π‘₯=βˆ’7 and 𝑦=6 in the point–slope form of the equation of the line. We can find the slope of our line by using the direction vector (βˆ’5,7). We know that our line has the direction (βˆ’5,7) and that the slope of a line is the rise divided by the run: π‘š==7βˆ’5=βˆ’75.riserun

We can substitute all of these values into the point–slope equation of a line and then rearrange this to find the general form: π‘¦βˆ’6=βˆ’75(π‘₯βˆ’(βˆ’7))π‘¦βˆ’6=βˆ’7π‘₯5βˆ’495𝑦+7π‘₯5βˆ’6+495=0𝑦+7π‘₯5+195=07π‘₯+5𝑦+19=0.

This is the equation of our line 𝐿 in the general form, so we will set π‘Ž=7, 𝑏=5, and 𝑐=19 in the formula for the distance between a point and a line. We will also substitute π‘₯=5 and 𝑦=7 into the formula to get 𝐷=|7(5)+5(7)+19|√5+7=89√74.

We can then rationalize the denominator: 89√74=89√74β‹…βˆš74√74=89√7474.

Hence, the perpendicular distance between the point (5,7) and the line βƒ‘π‘Ÿ=(βˆ’7,6)+𝑠(βˆ’5,7) is 89√7474 units.

Let’s now see an example of applying this formula to find the distance between a point and a line between two given points.

Example 3: Finding the Perpendicular Distance between a Given Point and a Straight Line

Find the length of the perpendicular drawn from the point 𝐴(βˆ’1,βˆ’7) to the straight line passing through the points 𝐡(6,βˆ’4) and 𝐢(9,βˆ’5).

Answer

We first recall the following formula for finding the perpendicular distance between a point and a line.

The perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

Therefore, we can find this distance by finding the general equation of the line passing through points 𝐡 and 𝐢. We can find the slope π‘š of this line by calculating the rise divided by the run: π‘š=βˆ’5βˆ’(βˆ’4)9βˆ’6=βˆ’13.

Using this slope and the coordinates of 𝐡 gives us the point–slope equation π‘¦βˆ’(βˆ’4)=βˆ’13(π‘₯βˆ’6), which we can rearrange into the general form as follows: 𝑦+4=βˆ’13(π‘₯βˆ’6)βˆ’3π‘¦βˆ’12=π‘₯βˆ’6π‘₯+3𝑦+6=0.

We have the values of the coefficients as π‘Ž=1, 𝑏=3, and 𝑐=6. From the coordinates of 𝐴, we have π‘₯=βˆ’1 and 𝑦=βˆ’7. Substituting these into our formula and simplifying yield 𝐷=|1(βˆ’1)+3(βˆ’7)+6|√1+3=|βˆ’1βˆ’21+6|√10=16√10=16√1010=8√105.

Hence, the perpendicular distance from the point 𝐴(βˆ’1,βˆ’7) to the straight line passing through the points 𝐡(6,βˆ’4) and 𝐢(9,βˆ’5) is 8√105 units.

In our next example, we will use the distance between a point and a given line to find an unknown coordinate of the point.

Example 4: Finding the Distances between Points and Straight Lines in Two Dimensions

If the length of the perpendicular drawn from the point (βˆ’5,𝑦) to the straight line βˆ’15π‘₯+8π‘¦βˆ’5=0 is 10 length units, find all the possible values of 𝑦.

Answer

We recall that the perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

We are told 𝐷=10, π‘₯=βˆ’5, 𝑦=π‘¦οŠ§, π‘Ž=βˆ’15, 𝑏=8, and 𝑐=βˆ’5. Substituting these values into the distance formula and rearranging yield 10=|βˆ’15(βˆ’5)+8π‘¦βˆ’5|(βˆ’15)+810=|75+8π‘¦βˆ’5|√28910=|70+8𝑦|17170=|70+8𝑦|.

Hence, either 170=70+8π‘¦βˆ’170=70+8𝑦.or

Solving the first equation, 170=70+8𝑦100=8𝑦𝑦=252.

Solving the second equation, βˆ’170=70+8π‘¦βˆ’240=8𝑦𝑦=βˆ’30.

Hence, the possible values are 𝑦=βˆ’30 or 𝑦=252.

We can see why there are two solutions to this problem with a sketch. We sketch the line βˆ’15π‘₯+8π‘¦βˆ’5=0 and the line π‘₯=βˆ’5, since this contains all points in the form (βˆ’5,𝑦).

We then see there are two points with π‘₯-coordinate βˆ’5 at a distance of 10 from the line βˆ’15π‘₯+8π‘¦βˆ’5=0.

In our previous example, we were able to use the perpendicular distance between an unknown point and a given line to determine the unknown coordinate of the point. In our next example, we will use the coordinates of a given point and its perpendicular distance to a line to determine possible values of an unknown coefficient in the equation of the line.

Example 5: Finding the Equation of a Straight Line given the Coordinates of a Point on the Line Perpendicular to It and the Distance between the Line and the Point

If the length of the perpendicular drawn from the point 𝐴(7,βˆ’1) to the straight line βˆ’5π‘₯βˆ’2𝑦+𝑐=0 equals 24√2929, find all possible values of 𝑐.

Answer

We recall that the perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

We are given π‘₯=7, 𝑦=βˆ’1, π‘Ž=βˆ’5, 𝑏=βˆ’2, and 𝐷=24√2929. Substituting these values into the formula and rearranging give us 24√2929=|βˆ’5(7)βˆ’2(βˆ’1)+𝑐|(βˆ’5)+(βˆ’2)24√2929=|βˆ’33+𝑐|√2924√2929ο€»βˆš29=|βˆ’33+𝑐|24=|βˆ’33+𝑐|.

Hence, there are two possibilities: 24=βˆ’33+π‘βˆ’24=βˆ’33+𝑐.or

Solving the first equation, 24=βˆ’33+𝑐𝑐=57.

Solving the second equation, βˆ’24=βˆ’33+𝑐𝑐=9.

This gives us that either 𝑐=57 or 𝑐=9.

We can see this in the following diagram.

Since we know the direction of the line and we know that its perpendicular distance from (7,βˆ’1) is 𝐷=24√2929, there are two possibilities based on whether the line lies to the left or the right of the point (7,βˆ’1).

We can extend the idea of the distance between a point and a line to finding the distance between parallel lines.

Let’s consider the distance between arbitrary points on two parallel lines 𝐿 and 𝐿, say π‘ƒοŠ§ and π‘ƒοŠ¨, as shown in the following figure.

We can see that this is not the shortest distance between these two lines by constructing the following right triangle.

The line segment π‘ƒπ‘ƒοŠ§οŠ¨ is the hypotenuse of the right triangle, so it is longer than the perpendicular distance between the two lines, 𝐷. Since the choice of π‘ƒοŠ§ and π‘ƒοŠ¨ was arbitrary, we can see that 𝐷 will be the shortest distance between points lying on either line.

We notice that because the lines are parallel, the perpendicular distance will stay the same. Hence, we can calculate this perpendicular distance anywhere on the lines. If we choose an arbitrary point π‘ƒοŠ§ on 𝐿, the perpendicular distance between a point and a line would be the same as the shortest distance between 𝐿 and 𝐿.

We can summarize this result as follows.

Definition: Distance between Two Parallel Lines in Two Dimensions

The distance between two parallel lines can be found as the perpendicular distance between any point on one line and the other line.

In our next example, we will see how we can apply this to find the distance between two parallel lines.

Example 6: Finding the Distance between Two Lines in Two Dimensions

What is the distance between lines (βˆ’16,βˆ’16)+π‘˜(2,4) and (19,βˆ’17)+π‘˜(7,14)?

Answer

We know that any two distinct parallel lines will never intersect, so we will start by checking if these two lines are parallel. We recall that two lines in vector form are parallel if their direction vectors are scalar multiples of each other. We see that (7,14)=72(2,4), so the two lines are parallel. This means we can determine the distance between them by using the formula for the distance between a point and a line, where we can choose any point on the other line.

We choose the point (βˆ’16,βˆ’16) on the first line and rewrite the second line in general form. Its slope π‘š is the change in 𝑦 over the change in π‘₯.This is given in the direction vector: π‘š=147=2.

Using the point (19,βˆ’17) and the slope, we can write the equation of the second line in point–slope form: π‘¦βˆ’(βˆ’17)=2(π‘₯βˆ’19).

We can then rearrange: 2π‘₯βˆ’π‘¦βˆ’55=0.

We want to find the perpendicular distance between (βˆ’16,βˆ’16) and 2π‘₯βˆ’π‘¦βˆ’55=0. We recall that the perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

We have π‘₯=βˆ’16, 𝑦=βˆ’16, π‘Ž=2, 𝑏=βˆ’1, and 𝑐=βˆ’55. Substituting these values in and evaluating yield 𝐷=|2(βˆ’16)βˆ’(βˆ’16)βˆ’55|2+(βˆ’1)=|βˆ’71|√5=71√55.

Hence, the distance between the two lines is 71√55 length units.

In our final example, we will use the perpendicular distance between a point and a line to find the area of a polygon.

Example 7: Finding the Area of a Parallelogram Using the Distance between Two Lines on the Coordinate Plane

Consider the parallelogram whose vertices have coordinates 𝐴(1,1), 𝐡(4,5), 𝐢(5,12), and 𝐷(2,8). Calculate the area of the parallelogram to the nearest square unit.

Answer

Recall that the area of a parallelogram is the length of its base multiplied by the perpendicular height. Since the opposite sides of a parallelogram are parallel, we can choose any point on one of the sides and find the perpendicular distance between this point and the opposite side to determine the perpendicular height of the parallelogram. We can therefore choose 𝐴𝐡 as the base and the distance between 𝐢 and ⃖⃗𝐴𝐡 as the height. The length of the base is the distance between 𝐴 and 𝐡. It is given by baselengthunits=(π‘₯βˆ’π‘₯)+(π‘¦βˆ’π‘¦)=(4βˆ’1)+(5βˆ’1)=√25=5.

To find the perpendicular distance between point 𝐢(5,12) and ⃖⃗𝐴𝐡, we recall that the perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.

We need to find the equation of the line between 𝐴 and 𝐡.The slope of this line is given by π‘š=π‘¦βˆ’π‘¦π‘₯βˆ’π‘₯=5βˆ’14βˆ’1=43.

Thus, the point–slope equation of this line is π‘¦βˆ’1=43(π‘₯βˆ’1), which we can write in general form as 3π‘¦βˆ’3=4π‘₯βˆ’44π‘₯βˆ’3π‘¦βˆ’1=0.

We can then find the height of the parallelogram by setting π‘₯=5, 𝑦=12, π‘Ž=4, 𝑏=βˆ’3, and 𝑐=βˆ’1: heightlengthunits=|4(5)βˆ’3(12)βˆ’1|4+(βˆ’3)=|βˆ’17|5=175.

Finally, we multiply the base length by the height to find the area: areasquareunits=5Γ—175=17.

Let’s finish by recapping some of the key points of this explainer.

Key Points

  • The perpendicular distance is the shortest distance between a point and a line.
  • The perpendicular distance, 𝐷, between the point 𝑃(π‘₯,𝑦) and the line 𝐿: π‘Žπ‘₯+𝑏𝑦+𝑐=0 is given by 𝐷=|π‘Žπ‘₯+𝑏𝑦+𝑐|βˆšπ‘Ž+𝑏.
  • We can find the distance between two parallel lines by finding the perpendicular distance between any point on one line and the other line.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.