DoAssignment.ca

G7 · Develop and use the distance formula for line segments

Learn to develop and use the distance formula for line segments through clear examples and targeted practice.

Ontario Grade 10 Mathematics

Analytic Geometry

Develop and use the distance formula for line segments

A map uses coordinates to show where places are. If two places are marked by points, their straight-line distance is the length of the line segment joining them. This lesson develops a way to find that length from the points' coordinates. You will first review how to count horizontal and vertical changes, then connect those changes to a right triangle.

What you will learn

1. Grade 9 bridge: coordinate changes

A point on a coordinate grid is named by an ordered pair, such as (2,3)(2, 3). The first number tells the horizontal position, and the second tells the vertical position. The horizontal axis is the left-to-right number line. The vertical axis is the up-and-down number line.
To find how far apart two points are horizontally, compare their first coordinates. To find their vertical separation, compare their second coordinates. For instance, points (1,2)(1, 2) and (5,5)(5, 5) have a horizontal change of 44 and a vertical change of 33.
A change can be negative if it points left or down. For distance, however, we need the size of each change. Squaring a number makes its square positive whether the original change was positive or negative.
Δx=x2−x1,Δy=y2−y1\Delta x=x_2-x_1,\quad \Delta y=y_2-y_1

2. From a right triangle to a distance formula

Imagine drawing a horizontal segment and a vertical segment from the endpoints of a slanted segment. These three segments make a right triangle. The slanted segment is the triangle's hypotenuse. The hypotenuse is the side opposite the right angle and is the longest side of a right triangle.
The Pythagorean theorem says that, in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides. Here, the horizontal and vertical changes are the two shorter sides. Their lengths are ∣x2−x1∣|x_2-x_1| and ∣y2−y1∣|y_2-y_1|. The absolute value bars mean the positive size of a number.
If the endpoints are (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2), the distance dd between them follows from the Pythagorean theorem. The squares remove the need to worry about whether a coordinate change was negative. The square root gives the segment's length rather than its squared length.
The order of the points does not change the distance. Reversing the subtraction changes the signs of both coordinate differences, but their squares stay the same.
d=(x2−x1)2+(y2−y1)2d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

3. Guided example: calculate and check

Find the length of the line segment joining A(−2,1)A(-2,1) and B(4,9)B(4,9). The labels AA and BB simply name the two points. Match the first coordinates with each other and the second coordinates with each other.
The horizontal change is 4−(−2)=64-(-2)=6. The vertical change is 9−1=89-1=8. These values are the two legs of the right triangle. Substitute them into the distance formula, square each change, add, and take the square root.
The result is 1010. This is reasonable: the horizontal and vertical changes are 66 and 88, so the slanted length should be greater than either change. If the coordinates represented metres, the segment would be 1010 metres long.
d=(4−(−2))2+(9−1)2=36+64=10d=\sqrt{(4-(-2))^2+(9-1)^2}=\sqrt{36+64}=10

4. Use the formula carefully

For any pair of endpoints, choose one point to be (x1,y1)(x_1,y_1) and the other to be (x2,y2)(x_2,y_2). Write the values into the formula in matching positions. You may swap the endpoint labels, but do not mix the first coordinate of one point with the second coordinate of the other.
If two points share the same first coordinate, the segment is vertical. Its length is the size of the difference between the second coordinates. If they share the same second coordinate, the segment is horizontal, and its length is the size of the difference between the first coordinates. The distance formula gives the same result in either case.
Keep the square root until the end of the calculation. If the number inside is a perfect square, the distance is a whole number. Otherwise, a decimal approximation may be useful. Follow the instructions of the question about rounding. Include units if the problem provides them.
Now try these independently. Find the distance between (1,−2)(1,-2) and (4,2)(4,2). Then find the distance between (−3,5)(-3,5) and (5,5)(5,5). For each one, identify the horizontal and vertical changes before calculating. Check your answers by considering whether the segment is horizontal, vertical, or slanted.

Coordinate changes for the guided example

DirectionCoordinate subtractionChange
Horizontal4−(−2)4-(-2)66
Vertical9−19-188
Segment length62+82\sqrt{6^2+8^2}1010

Worked example

Distance between two slanted-segment endpoints

Find the distance between A(−2,1)A(-2,1) and B(4,9)B(4,9).
  1. Find the coordinate changes
    Subtract the first coordinates to get the horizontal change. Subtract the second coordinates to get the vertical change. These changes are the legs of the right triangle formed by the segment.
    Δx=4−(−2)=6,Δy=9−1=8\Delta x=4-(-2)=6,\quad \Delta y=9-1=8
  2. Substitute into the distance formula
    The formula combines the squares of the two leg lengths. This is the Pythagorean theorem applied to the triangle between the points.
    d=62+82d=\sqrt{6^2+8^2}
  3. Calculate the length
    Square each change, add the results, and take the square root. The distance is the positive length of the segment.
    d=36+64=100=10d=\sqrt{36+64}=\sqrt{100}=10
Answer: The distance between AA and BB is 1010 units.
Check: The answer is greater than both the horizontal change, 66, and the vertical change, 88, as expected for a slanted segment.

Common mistakes and how to avoid them

Adding the coordinates instead of finding the changes.
Correction: Subtract matching coordinates to find the horizontal and vertical changes. Then square those changes.
Leaving a negative distance because one coordinate change is negative.
Correction: The changes are squared in the formula, so their signs do not make the distance negative.
Forgetting the square root and reporting the sum of the squared changes.
Correction: The sum gives the square of the distance. Take its square root to find the length.
Mixing the coordinates of the two endpoints.
Correction: Subtract first coordinates from first coordinates, and second coordinates from second coordinates.

Lesson summary

Check your understanding

Question 1

What is the distance between (2,1)(2,1) and (2,7)(2,7)?
  1. 66
  2. 88
  3. 3636
  4. 13\sqrt{13}
Show answer and explanation
66
The first coordinates are the same, so the segment is vertical. Its length is the difference between the second coordinates: 7−1=67-1=6.

Question 2

What is the distance between (0,0)(0,0) and (5,12)(5,12)?
  1. 77
  2. 1313
  3. 1717
  4. 169169
Show answer and explanation
1313
The changes are 55 and 1212. The distance is 52+122=169=13\sqrt{5^2+12^2}=\sqrt{169}=13.

Question 3

Why does the distance formula square each coordinate change?
  1. To use the two changes as the sides of a right triangle and remove any negative signs
  2. To make the horizontal change twice as large
  3. To avoid taking a square root
  4. To show that every segment is vertical
Show answer and explanation
To use the two changes as the sides of a right triangle and remove any negative signs
The changes are the legs of a right triangle, so their squares are added by the Pythagorean theorem. Squaring also makes each contribution non-negative.

Key terms

Coordinate
A number that tells a point's position along one axis of a grid.
Line segment
A straight part of a line with two endpoints.
Hypotenuse
The side opposite the right angle in a right triangle.
Distance formula
A rule that uses the coordinates of two points to calculate the length of the segment between them.

Continue through MPM2D

View the complete MPM2D Ontario Grade 10 Mathematics curriculum and lessons

About this lesson

Published by DoAssignment. This AI-assisted lesson follows Ontario Grade 10 Mathematics (MPM2D), study topic G7. It is a study resource, not an official curriculum publication.

Official curriculum reference

Report a correction or ask a question