Math Core

Lesson 7.4 · The Pythagorean Theorem

Distance on the coordinate plane

How far apart are two points on a map or a coordinate grid? If they line up horizontally or vertically, you can just count. If they don't, the grid gives you a right triangle for free, and the Pythagorean theorem does the rest.

Horizontal and vertical distances

When two points have the same yy-coordinate, they lie on a horizontal line. The distance between them is the difference of their xx-coordinates. When they have the same xx-coordinate, subtract the yy-coordinates.

  • (1,3)(1, 3) and (6,3)(6, 3): distance 6−1=56 - 1 = 5.
  • (2,−4)(2, -4) and (2,5)(2, 5): distance 5−(−4)=95 - (-4) = 9.

Distance is never negative. If you subtract in the "wrong" order, just drop the negative sign: ∣1−6∣=5|1 - 6| = 5.

Slanted distances

Now take the points (1,2)(1, 2) and (4,6)(4, 6). The segment between them is slanted, so you can't count squares along it. Instead, draw a horizontal leg and a vertical leg to make a right triangle.

The segment from (1, 2) to (4, 6) is the hypotenuse of a right triangle with legs 3 and 4.Open in grapher →
  • The horizontal leg goes from x=1x = 1 to x=4x = 4, so it is 4−1=34 - 1 = 3 units long.
  • The vertical leg goes from y=2y = 2 to y=6y = 6, so it is 6−2=46 - 2 = 4 units long.
  • The distance is the hypotenuse: d=32+42=25=5d = \sqrt{3^2 + 4^2} = \sqrt{25} = 5.

Distance between two points

To find the distance between two points:

  1. Find the horizontal change (the difference of the xx-coordinates).
  2. Find the vertical change (the difference of the yy-coordinates).
  3. Use them as the legs of a right triangle: d=(horizontal change)2+(vertical change)2d = \sqrt{(\text{horizontal change})^2 + (\text{vertical change})^2}.

Worked example: Points in different quadrants

Find the distance between (−3,4)(-3, 4) and (2,−2)(2, -2), exactly and to the nearest tenth.

The legs meet at the corner (2, 4).Open in grapher →
  • Horizontal change: from x=−3x = -3 to x=2x = 2 is 2−(−3)=52 - (-3) = 5 units.
  • Vertical change: from y=4y = 4 to y=−2y = -2 is 4−(−2)=64 - (-2) = 6 units.

d=52+62=25+36=61≈7.8d = \sqrt{5^2 + 6^2} = \sqrt{25 + 36} = \sqrt{61} \approx 7.8

Common mistake

Be careful when a coordinate is negative. From x=−3x = -3 to x=2x = 2 is 55 units, not 2−3=−12 - 3 = -1. Subtracting a negative means adding: 2−(−3)=2+3=52 - (-3) = 2 + 3 = 5. You can also count the squares on the grid to check.

The distance formula

If you write the steps above with letters, you get a formula. For points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2),

d=(x2−x1)2+(y2−y1)2.d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.

This is just the Pythagorean theorem in disguise: x2−x1x_2 - x_1 is the horizontal leg and y2−y1y_2 - y_1 is the vertical leg. Because each difference is squared, it doesn't matter which point you call the first one. A negative difference becomes positive when you square it.

Worked example: Perimeter of a triangle

A triangle has vertices A(−2,−1)A(-2, -1), B(4,−1)B(4, -1) and C(1,3)C(1, 3). Find its perimeter.

Find each side.

  • ABAB: the points share y=−1y = -1, so AB=4−(−2)=6AB = 4 - (-2) = 6.
  • ACAC: horizontal change 1−(−2)=31 - (-2) = 3, vertical change 3−(−1)=43 - (-1) = 4. So AC=32+42=5AC = \sqrt{3^2 + 4^2} = 5.
  • BCBC: horizontal change 4−1=34 - 1 = 3, vertical change 3−(−1)=43 - (-1) = 4. So BC=32+42=5BC = \sqrt{3^2 + 4^2} = 5.

The perimeter is 6+5+5=166 + 5 + 5 = 16 units. (Two sides are equal, so the triangle is isosceles.)

Tip

Sketch the points before you compute, even roughly. A sketch shows you which way the legs go and gives you a quick estimate to check your answer against.

Practice

Practice 1

What is the distance between (2,1)(2, 1) and (2,8)(2, 8)?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

What is the distance between (−6,5)(-6, 5) and (4,5)(4, 5)?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

What is the distance from the origin (0,0)(0, 0) to the point (6,8)(6, 8)?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

What is the distance between (1,−2)(1, -2) and (13,3)(13, 3)?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Find the exact distance between (−4,−1)(-4, -1) and (2,3)(2, 3). (You can type a square root as sqrt(…).)

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Find the distance between (−2,6)(-2, 6) and (3,−1)(3, -1), to the nearest tenth.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Which point is farther from the origin: P(5,5)P(5, 5) or Q(1,−7)Q(1, -7)?

Practice 8

A triangle has vertices A(1,1)A(1, 1), B(4,5)B(4, 5) and C(8,2)C(8, 2). Find its perimeter to the nearest tenth.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.