The perpendicular distance formula, the distance between parallel lines, altitudes and areas of triangles, and which side of a line a point lies on.
Lesson 7 of 8
5 min read
10 practice questions
The distance from a point to a line means the shortest distance, which is measured along the perpendicular from the point to the line. There is a neat formula for it, and from it come the distance between two parallel lines, the altitude and area of a triangle, and a test for whether two points lie on the same side of a line. This lesson develops all of these.
The perpendicular distance formula
Result. The perpendicular distance from the point P(x1,y1) to the line ax+by+c=0 is
d=a2+b2∣ax1+by1+c∣
In words: substitute the point into the left side of the equation, take the modulus, and divide by a2+b2.
Why. Let the line cut the axes at A(−ac,0) and B(0,−bc) (assume a, b, c non-zero; the other cases are simpler). The area of triangle PAB can be found in two ways: as 21×AB×d, and from the coordinates by the determinant formula. Working this out, the area is 2∣ab∣∣c∣∣ax1+by1+c∣, while AB=∣ab∣∣c∣a2+b2. Equating the two expressions for the area and cancelling gives the formula.
Special case. The distance from the origin to ax+by+c=0 is a2+b2∣c∣.
Example 1
Find the distance from (2,3) to the line 3x+4y−8=0.
d=9+16∣3(2)+4(3)−8∣=5∣6+12−8∣=510=2
Example 2
Find k if the distance from (k,2) to 4x−3y+1=0 is 3.
5∣4k−6+1∣=3⟹∣4k−5∣=15⟹4k−5=15 or 4k−5=−15
So k=5 or k=−25. There are two such points, one on each side of the line.
Distance between parallel lines
Two parallel lines can be written with the same x and y coefficients: ax+by+c1=0 and ax+by+c2=0. The distance between them is
d=a2+b2∣c1−c2∣
(Take any point on one line and find its distance from the other.) Before using the formula, make sure the coefficients of x and y are the same in both equations.
Example 3
Find the distance between 3x+4y−8=0 and 6x+8y+9=0.
Divide the second equation by 2 to match the first: 3x+4y+29=0. Then
d=9+16−8−29=5225=25
Altitude and area of a triangle
The altitude from a vertex is the distance from that vertex to the line of the opposite side.
Example 4
In the triangle with vertices A(1,3), B(0,0), C(4,3), find the altitude from A and the area.
The line BC passes through the origin with slope 43, so it is 3x−4y=0. The altitude from A is
9+16∣3(1)−4(3)∣=5∣3−12∣=59
BC=16+9=5, so the area is 21×5×59=29 square units. (The determinant formula from the matrices course gives the same: 21∣1(0−3)−3(0−4)+1(0)∣=29.)
Which side of a line?
For the line ax+by+c=0, the expression ax+by+c is zero on the line, positive for all points on one side and negative for all points on the other side. So:
two points are on the same side of the line if ax+by+c has the same sign at both;
they are on opposite sides if the signs are different.
Example 5
Are (1,1) and (2,−1) on the same side of x+2y−2=0?
At (1,1): 1+2−2=1>0. At (2,−1): 2−2−2=−2<0. The signs differ, so the points are on opposite sides, and the line passes between them.
Practice
Find the distance from (3,−2) to 4x+3y+4=0.
Find the distance from the origin to 12x−5y+26=0.
Find the distance from (1,1) to x−y+2=0.
Find the distance between 3x−4y+7=0 and 3x−4y−13=0.
Find the distance between 2x+y−3=0 and 4x+2y+4=0.
Find k if the distance from (1,k) to 3x+4y−5=0 is 2.
Are (2,3) and (−1,5) on the same side of 2x−y+1=0?
Is the origin on the same side of x+y−4=0 as the point (1,5)?
Find the area of the triangle with vertices (1,3), (0,0) and (4,3) by a different method from Example 4: use the altitude from C to AB.
Find the points on the x-axis whose distance from 4x+3y−12=0 is 3.
Answers
Show answers
5∣12−6+4∣=510=2.
144+2526=1326=2.
2∣1−1+2∣=22=2.
5∣7−(−13)∣=520=4.
Write the second as 2x+y+2=0. Then d=5∣−3−2∣=55=5.
5∣3+4k−5∣=2, so ∣4k−2∣=10, giving 4k−2=10 or 4k−2=−10: k=3 or k=−2.
At (2,3): 4−3+1=2>0. At (−1,5): −2−5+1=−6<0. Opposite sides.
At the origin: −4<0. At (1,5): 1+5−4=2>0. No, they are on opposite sides.
Here A(1,3), B(0,0), C(4,3). AB is y=3x, that is, 3x−y=0, and AB=10. The altitude from C is 10∣12−3∣=109, so the area is 21×10×109=29 square units.
For (a,0): 5∣4a−12∣=3, so 4a−12=±15, giving a=427 or a=−43. The points are (427,0) and (−43,0).