Grade by Grade
Analytic Geometry · Analytic Geometry

The Distance from a Point to a Line

2.5About 70 minutes
Learning goals
  • I can explain why the shortest distance from a point to a line is the perpendicular distance.
  • I can find the foot of the perpendicular by solving a linear system.
  • I can find the distance from a point to a line, including horizontal and vertical lines.
  • I can solve real problems involving shortest distances.

Words to know

distance from a point to a line
The length of the perpendicular segment from the point to the line; the shortest distance.
foot of the perpendicular
The point where the perpendicular from a point meets the line.
perpendicular
Meeting at a right angle (90°).
hypotenuse
The longest side of a right triangle, opposite the right angle.

The shortest way to the road

A cabin sits in the woods near a straight highway. The owners want to build the shortest possible driveway to the highway. Which way should it go? Try it with a ruler on a sketch: the shortest path from a point to a line always meets the line at a right angle. That shortest length is called the distance from a point to a line.

Why perpendicular is shortest

Let F be the point on the line where the perpendicular from P meets it (F is called the foot of the perpendicular). Pick any other point Q on the line. Then triangle PFQ has a right angle at F, so PQ is its hypotenuse. The hypotenuse is always the longest side of a right triangle, so PQ > PF. No other point on the line is closer to P than F.

xyP(−2, 3)F(2, 1)PF ≈ 4.475√40 ≈ 6.32y = 2x − 3
The perpendicular segment PF (√20 ≈ 4.47) meets the line at a right angle and is shorter than the dashed segments from P to other points on the line, (3, 3) and (0, −3), which have lengths 5 and √40 ≈ 6.32. Each grid square is 1 unit. The distance from P to the line is PF.

Four steps to the distance from a point to a line

  1. Find the slope of the given line.
  2. Write the equation of the perpendicular line through the point (use the negative reciprocal slope).
  3. Solve the linear system formed by the two lines to find the foot F. (This uses the methods from the start of this unit.)
  4. Use the length formula to find the distance from the point to F.
1. Slopeof the given linem = 22. Perpendicularline through Py = −½x + 23. Solve thesystem for FF(2, 1)4. LengthPF√20 ≈ 4.47
The four steps, with the results from Example 1 underneath each one.
Worked example

Example 1: Distance from a point to a line

Find the distance from P(−2, 3) to the line y = 2x − 3.

  1. Step 1: the slope of y = 2x − 3 is 2.
  2. Step 2: the perpendicular slope is −1/2. Through P(−2, 3): 3 = −1/2(−2) + b = 1 + b, so b = 2. The perpendicular line is y = −(1/2)x + 2.
  3. Step 3: solve 2x − 3 = −(1/2)x + 2. Multiply by 2: 4x − 6 = −x + 4, so 5x = 10, x = 2. Then y = 2(2) − 3 = 1. The foot is F(2, 1).
  4. Step 4: PF = √[(2 − (−2))² + (1 − 3)²] = √(16 + 4) = √20 ≈ 4.47.
  5. Verify with technology: in GeoGebra, draw the line and the point, use the Perpendicular Line tool, the Intersect tool and the Distance tool. You should get about 4.47.

The distance from P to the line is √20 ≈ 4.47 units.

Worked example

Example 2: Horizontal and vertical lines

Find the distance from (4, −3) to (a) the line y = 5 and (b) the line x = −1.

  1. (a) y = 5 is horizontal, so the perpendicular from (4, −3) is vertical. The foot is (4, 5). Distance = 5 − (−3) = 8.
  2. (b) x = −1 is vertical, so the perpendicular is horizontal. The foot is (−1, −3). Distance = 4 − (−1) = 5.

(a) 8 units; (b) 5 units. For horizontal and vertical lines, just count along the grid.

Worked example

Example 3: The shortest driveway

On a map (units in km), a cabin is at C(6, 8) and a straight highway follows y = −x + 4. How long is the shortest possible driveway, and where does it meet the highway?

  1. Step 1: the highway's slope is −1.
  2. Step 2: the perpendicular slope is 1. Through C(6, 8): 8 = 6 + b, b = 2. So y = x + 2.
  3. Step 3: x + 2 = −x + 4, so 2x = 2, x = 1, y = 3. The driveway meets the highway at F(1, 3).
  4. Step 4: CF = √[(6 − 1)² + (8 − 3)²] = √(25 + 25) = √50 ≈ 7.07.

The shortest driveway is √50 ≈ 7.07 km, meeting the highway at (1, 3). (That is a long driveway: maybe a forest road!)

Worked example

Example 4: Line in standard form

Find the distance from P(5, 4) to the line 3x + 4y = 7.

  1. Step 1: rearrange: 4y = −3x + 7, y = −(3/4)x + 7/4. Slope −3/4.
  2. Step 2: perpendicular slope 4/3. Through (5, 4): 4 = 20/3 + b, b = 4 − 20/3 = −8/3. So y = (4/3)x − 8/3, or 4x − 3y = 8.
  3. Step 3: solve 3x + 4y = 7 and 4x − 3y = 8 by elimination. Multiply by 3 and 4: 9x + 12y = 21 and 16x − 12y = 32. Add: 25x = 53, x = 2.12. Then 4y = 7 − 6.36 = 0.64, y = 0.16. F(2.12, 0.16).
  4. Step 4: PF = √[(5 − 2.12)² + (4 − 0.16)²] = √(2.88² + 3.84²) = √(8.2944 + 14.7456) = √23.04 = 4.8.

The distance is 4.8 units.

Just for fun

Funny-but-true: people say "as the crow flies" to mean straight-line distance. Real crows swoop, circle and stop for snacks, but mathematicians have never let that spoil a good phrase.

Hands-on activity

Find the shortest path to a wall

You need: a measuring tape or a long piece of string, a book or a sheet of paper (its square corner is a right-angle tester), and a chair or other object about 1 to 2 m from a straight wall.

  1. Stand at the chair. Use the string or tape to measure from the chair to the wall at four or five different angles (straight in, and leaning left and right). Record each length.
  2. Find the shortest one. At the point where it touches the wall, check the angle between the string and the wall with the corner of the book.
  3. Now make it a coordinate problem: let the wall be the x-axis and the chair be at (0, h), where h is your shortest measurement. For one of your slanted measurements, where along the wall did it touch, roughly (x, 0)? Use the length formula to calculate √(x² + h²) and compare with what you measured.

What to look for: the shortest string meets the wall at a right angle (the book corner fits). Slanted strings are longer, and √(x² + h²) should be close to the measured slanted length.

Your turn

1

Find the distance from (3, 7) to the line y = 2.

2

Find the distance from (−6, 1) to the line x = 4.

3

Find the distance from (0, 5) to the line y = x + 1.

4

Find the distance from (1, 6) to the line y = 3x − 7.

5

Find the foot of the perpendicular from (7, 0) to y = (1/2)x.

6

A water pipe follows the line y = −2x + 1 (units in m). A tap at (4, 2) must be connected with the shortest possible branch pipe. How long is it?

More practice: warm-up

1

At what angle does the shortest path from a point to a line meet the line?

2

What is the perpendicular slope to y = −4x + 1?

3

Find the distance from the origin to the line y = −3.

4

Find the distance from (2, 2) to the x-axis.

5

Why is the hypotenuse of a right triangle longer than either leg?

More practice: on your own

1

Find the distance from (−3, −1) to the line y = x + 4.

2

Find the distance from (6, 2) to the line y = −(1/3)x.

3

Find the distance from (2, 9) to the line 2x − y = −5.

4

Find the distance between the parallel lines y = 2x + 1 and y = 2x − 4. (Hint: pick a point on one line.)

5

A lighthouse at L(8, 6) (units in km) watches a ship moving along the straight course y = (3/4)x − 2. How close does the ship come to the lighthouse?

Challenge

1

Find the area of the triangle with vertices A(0, 0), B(8, 2) and C(2, 6) by using AB as the base and the distance from C to line AB as the height.

2

Find the points on the line y = 2x − 3 that are exactly 5 units from P(−2, 3). (Use the foot F(2, 1) and √20 from Example 1.)

3

Explain why the distance from a point to a line is defined as the perpendicular distance, and not, say, the distance to the y-intercept.

Check your understanding

Quiz

1.

The shortest distance from a point to a line is measured along a segment that is:

2.

What is the distance from (5, −2) to the line y = 4?

3.

To find the foot of the perpendicular, you must:

4.

The line has slope 3/2. What slope does the perpendicular through the point have?

5.

The foot of the perpendicular from P(1, 1) to a line is F(4, 5). What is the distance from P to the line?

6.

What is the distance from (0, 0) to the line y = −x + 2?

For parents and teachers

Big idea: the distance from a point to a line is the length of the perpendicular segment. Finding it combines almost everything in the unit: slopes, perpendicular lines, solving a linear system, and the length formula. This lesson teaches the second example in expectation 2.5 (determine the distance from a given point to a line whose equation is given, and verify using dynamic geometry software).

How to help: Have your teen list the four steps on a card and tick them off. If you have a computer, GeoGebra (free) lets them check answers by measuring.

Common difficulties:

  • Measuring to the y-intercept or to some other convenient point on the line instead of to the foot of the perpendicular.
  • Using the original slope instead of the negative reciprocal.
  • Arithmetic errors with fractions when solving the system. Clearing fractions first (multiply through) helps.
  • Rounding the foot's coordinates too early, which makes the final distance slightly wrong.