Skip to content
Family Table Math
Auto

Length of a Line Segment

How long is a slanted segment on a grid? You can’t just count squares, but you can turn the segment into the hypotenuse of a right triangle and use the Pythagorean theorem. That idea gives the length formula (also called the distance formula), which you’ll use to find perimeters, compare side lengths, and later to build the equation of a circle.

If two points are on the same horizontal line, the length is just the difference in xx-coordinates. From (−2,3)(-2, 3) to (5,3)(5, 3) the length is 5−(−2)=75 - (-2) = 7. For a vertical segment, use the difference in yy-coordinates. Lengths are never negative, so subtract the smaller from the larger.

For a slanted segment ABAB, draw a horizontal leg from AA and a vertical leg up (or down) to BB. They meet at a right angle, so ABAB is the hypotenuse.

Segment AB from A(-2, -1) to B(4, 7) is the hypotenuse of a right triangle with a horizontal leg of 6 and a vertical leg of 8, so AB = 10. 2 6 2 4 6 8 A(−2, −1) B(4, 7) 6 8 AB = 10
The horizontal leg is 66, the vertical leg is 88, so AB=62+82=10AB = \sqrt{6^2 + 8^2} = 10.

The horizontal leg is the change in xx, and the vertical leg is the change in yy. By the Pythagorean theorem:

AB2=(change in x)2+(change in y)2AB^2 = (\text{change in } x)^2 + (\text{change in } y)^2

The length of the segment joining A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2) is

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

Squaring makes every term positive, so it doesn’t matter which point you call AA, and a negative change in xx or yy is fine.

Often the answer is a square root that isn’t a whole number, like 50\sqrt{50}. That’s the exact answer. You can also give a decimal approximation, like 50≈7.07\sqrt{50} \approx 7.07. Keep the exact form while you’re still working, and round only at the end. If you’ve learned to simplify radicals, you can write 50=25×2=52\sqrt{50} = \sqrt{25 \times 2} = 5\sqrt{2}.

Find all three side lengths, then compare:

TypeSide lengths
Equilateralall three sides equal
Isoscelesexactly two sides equal
Scaleneno sides equal

To check for a right triangle, test the Pythagorean theorem backwards: if the squares of the two shorter sides add up to the square of the longest side, the triangle has a right angle. (You can also use slopes, as on verifying geometric properties.)

Find the length of the segment joining A(−2,−1)A(-2, -1) and B(4,7)B(4, 7).

Solution.

AB=(4−(−2))2+(7−(−1))2=62+82=36+64=100=10\begin{aligned} AB &= \sqrt{(4 - (-2))^2 + (7 - (-1))^2} \\ &= \sqrt{6^2 + 8^2} \\ &= \sqrt{36 + 64} \\ &= \sqrt{100} \\ &= 10 \end{aligned}

This is the segment in the figure above: legs of 66 and 88, hypotenuse 1010.

Find the length of CDCD, with C(−3,4)C(-3, 4) and D(2,−1)D(2, -1). Give the exact answer and a decimal to two decimal places.

Solution.

CD=(2−(−3))2+(−1−4)2=52+(−5)2=25+25=50\begin{aligned} CD &= \sqrt{(2 - (-3))^2 + (-1 - 4)^2} \\ &= \sqrt{5^2 + (-5)^2} \\ &= \sqrt{25 + 25} \\ &= \sqrt{50} \end{aligned}

The exact length is 50\sqrt{50} (or 525\sqrt{2}), which is about 7.077.07.

Notice that (−5)2=25(-5)^2 = 25. Squaring a negative change gives a positive number.

A triangle has vertices A(1,1)A(1, 1), B(5,3)B(5, 3) and C(3,7)C(3, 7). Classify it by its side lengths, and decide whether it’s a right triangle.

Solution. Find all three lengths:

AB=(5−1)2+(3−1)2=16+4=20BC=(3−5)2+(7−3)2=4+16=20AC=(3−1)2+(7−1)2=4+36=40\begin{aligned} AB &= \sqrt{(5 - 1)^2 + (3 - 1)^2} = \sqrt{16 + 4} = \sqrt{20} \\ BC &= \sqrt{(3 - 5)^2 + (7 - 3)^2} = \sqrt{4 + 16} = \sqrt{20} \\ AC &= \sqrt{(3 - 1)^2 + (7 - 1)^2} = \sqrt{4 + 36} = \sqrt{40} \end{aligned}

AB=BCAB = BC, so the triangle is isosceles.

Now test for a right angle. The longest side is ACAC. Compare squares:

AB2+BC2=20+20=40=AC2AB^2 + BC^2 = 20 + 20 = 40 = AC^2

The squares match, so the triangle is also a right triangle, with the right angle at BB (the vertex opposite the longest side). It’s an isosceles right triangle.

Squared lengths are easy here: AB2=20AB^2 = 20, so you never need to round.

A garden plan uses a grid in metres. The garden has corners A(−4,0)A(-4, 0), B(0,3)B(0, 3), C(5,3)C(5, 3) and D(2,−1)D(2, -1). Fencing costs $18 per metre. Find the perimeter, and the cost to fence the garden.

Solution. Find each side, going around the shape in order:

AB=(0−(−4))2+(3−0)2=16+9=25=5BC=5−0=5horizontalCD=(2−5)2+(−1−3)2=9+16=25=5DA=(−4−2)2+(0−(−1))2=36+1=37\begin{aligned} AB &= \sqrt{(0 - (-4))^2 + (3 - 0)^2} = \sqrt{16 + 9} = \sqrt{25} = 5 \\ BC &= 5 - 0 = 5 && \text{horizontal} \\ CD &= \sqrt{(2 - 5)^2 + (-1 - 3)^2} = \sqrt{9 + 16} = \sqrt{25} = 5 \\ DA &= \sqrt{(-4 - 2)^2 + (0 - (-1))^2} = \sqrt{36 + 1} = \sqrt{37} \end{aligned} Perimeter=5+5+5+37=15+37≈15+6.083=21.083\text{Perimeter} = 5 + 5 + 5 + \sqrt{37} = 15 + \sqrt{37} \approx 15 + 6.083 = 21.083

The perimeter is about 21.0821.08 m. The cost is 21.083×18≈379.4921.083 \times 18 \approx 379.49, so it costs about $379.49 to fence the garden.

Keep the extra decimal places until the last step, so your rounding doesn’t change the cost.

Adding the changes instead of squaring them. The length from (−2,−1)(-2, -1) to (4,7)(4, 7) is not 6+8=146 + 8 = 14. Walking along the two legs is longer than cutting straight across. Square, add, then take the square root.

Taking the square root of each term separately. 36+64\sqrt{36 + 64} is 100=10\sqrt{100} = 10, not 36+64=14\sqrt{36} + \sqrt{64} = 14. Add first, then take the root.

Sign errors with negative coordinates. 4−(−2)=64 - (-2) = 6, not 22. Use brackets when you substitute a negative coordinate. Once you square, a negative change becomes positive anyway, but only if you subtracted correctly first.

Mixing coordinates from different points. Subtract xx from xx and yy from yy, using the same two points. Label the points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) before you substitute.

Rounding too early. Rounding each side before adding can change the perimeter. Keep exact values (or at least three decimal places) until the final answer.

Testing the wrong sides for a right angle. The longest side must be on its own: check whether the two shorter sides’ squares add to the longest side’s square.

1. (Warm-up) Find the length of each segment.

  • (a) (1,2)(1, 2) and (4,6)(4, 6)
  • (b) (−3,7)(-3, 7) and (5,7)(5, 7)
Solution

(a) (4−1)2+(6−2)2=9+16=25=5\sqrt{(4 - 1)^2 + (6 - 2)^2} = \sqrt{9 + 16} = \sqrt{25} = 5

(b) The segment is horizontal: 5−(−3)=85 - (-3) = 8.

2. (Warm-up) Find the length of each segment. Give exact answers, and a decimal to two decimal places where needed.

  • (a) (0,0)(0, 0) and (−5,12)(-5, 12)
  • (b) (−2,3)(-2, 3) and (4,−1)(4, -1)
Solution

(a) (−5)2+122=25+144=169=13\sqrt{(-5)^2 + 12^2} = \sqrt{25 + 144} = \sqrt{169} = 13

(b) (4−(−2))2+(−1−3)2=36+16=52≈7.21\sqrt{(4 - (-2))^2 + (-1 - 3)^2} = \sqrt{36 + 16} = \sqrt{52} \approx 7.21 (exact: 52=213\sqrt{52} = 2\sqrt{13})

3. (Core) Find the length of the segment from A(−4,−3)A(-4, -3) to B(3,1)B(3, 1), exactly and to two decimal places.

SolutionAB=(3−(−4))2+(1−(−3))2=72+42=49+16=65≈8.06AB = \sqrt{(3 - (-4))^2 + (1 - (-3))^2} = \sqrt{7^2 + 4^2} = \sqrt{49 + 16} = \sqrt{65} \approx 8.06

4. (Core) Classify the triangle with vertices J(−3,2)J(-3, 2), K(3,4)K(3, 4) and L(1,−2)L(1, -2) by its side lengths. Is it a right triangle?

SolutionJK=(3−(−3))2+(4−2)2=36+4=40KL=(1−3)2+(−2−4)2=4+36=40JL=(1−(−3))2+(−2−2)2=16+16=32\begin{aligned} JK &= \sqrt{(3 - (-3))^2 + (4 - 2)^2} = \sqrt{36 + 4} = \sqrt{40} \\ KL &= \sqrt{(1 - 3)^2 + (-2 - 4)^2} = \sqrt{4 + 36} = \sqrt{40} \\ JL &= \sqrt{(1 - (-3))^2 + (-2 - 2)^2} = \sqrt{16 + 16} = \sqrt{32} \end{aligned}

JK=KLJK = KL, so the triangle is isosceles.

The longest sides are JKJK and KLKL (both 40\sqrt{40}). Test: JL2+KL2=32+40=72JL^2 + KL^2 = 32 + 40 = 72, which is not JK2=40JK^2 = 40. No pair works, so it is not a right triangle.

5. (Core) Find the perimeter of the triangle with vertices P(−3,1)P(-3, 1), Q(3,4)Q(3, 4) and R(1,−2)R(1, -2), to one decimal place.

SolutionPQ=(3−(−3))2+(4−1)2=36+9=45≈6.708QR=(1−3)2+(−2−4)2=4+36=40≈6.325PR=(1−(−3))2+(−2−1)2=16+9=25=5\begin{aligned} PQ &= \sqrt{(3 - (-3))^2 + (4 - 1)^2} = \sqrt{36 + 9} = \sqrt{45} \approx 6.708 \\ QR &= \sqrt{(1 - 3)^2 + (-2 - 4)^2} = \sqrt{4 + 36} = \sqrt{40} \approx 6.325 \\ PR &= \sqrt{(1 - (-3))^2 + (-2 - 1)^2} = \sqrt{16 + 9} = \sqrt{25} = 5 \end{aligned}Perimeter≈6.708+6.325+5=18.033\text{Perimeter} \approx 6.708 + 6.325 + 5 = 18.033

The perimeter is about 18.018.0 units.

6. (Core) A delivery drone flies in a straight line from (−300,200)(-300, 200) to (500,−400)(500, -400) on a grid measured in metres.

  • (a) How far does it fly?
  • (b) At 88 m/s, how long does the flight take?
Solution

(a)

(500−(−300))2+(−400−200)2=8002+(−600)2=640 000+360 000=1 000 000=1000\sqrt{(500 - (-300))^2 + (-400 - 200)^2} = \sqrt{800^2 + (-600)^2} = \sqrt{640\,000 + 360\,000} = \sqrt{1\,000\,000} = 1000

The drone flies 10001000 m.

(b) time=10008=125\text{time} = \dfrac{1000}{8} = 125 seconds.

7. (Core) The point (k,3)(k, 3) is 55 units from (1,−1)(1, -1). Find all possible values of kk.

Solution

Set the length equal to 55 and square both sides:

(k−1)2+(3−(−1))2=25(k−1)2+16=25(k−1)2=9k−1=3ork−1=−3k=4ork=−2\begin{aligned} (k - 1)^2 + (3 - (-1))^2 &= 25 \\ (k - 1)^2 + 16 &= 25 \\ (k - 1)^2 &= 9 \\ k - 1 &= 3 \quad \text{or} \quad k - 1 = -3 \\ k &= 4 \quad \text{or} \quad k = -2 \end{aligned}

Check k=4k = 4: 32+42=5\sqrt{3^2 + 4^2} = 5. ✓ Check k=−2k = -2: (−3)2+42=5\sqrt{(-3)^2 + 4^2} = 5. ✓

8. (Challenge) Find the point on the yy-axis that is the same distance from A(−2,1)A(-2, 1) as from B(4,5)B(4, 5).

Solution

A point on the yy-axis has the form (0,y)(0, y). Set the squared distances equal (squaring avoids the square roots):

(0−(−2))2+(y−1)2=(0−4)2+(y−5)24+y2−2y+1=16+y2−10y+25−2y+5=−10y+418y=36y=4.5\begin{aligned} (0 - (-2))^2 + (y - 1)^2 &= (0 - 4)^2 + (y - 5)^2 \\ 4 + y^2 - 2y + 1 &= 16 + y^2 - 10y + 25 \\ -2y + 5 &= -10y + 41 \\ 8y &= 36 \\ y &= 4.5 \end{aligned}

The point is (0,4.5)(0, 4.5).

Check: distance squared to AA is 4+3.52=16.254 + 3.5^2 = 16.25, and to BB is 16+(−0.5)2=16.2516 + (-0.5)^2 = 16.25. ✓

9. (Challenge) A triangle has vertices A(−4,2)A(-4, 2), B(6,4)B(6, 4) and C(2,−6)C(2, -6). Join the midpoints of the three sides to make a smaller triangle. Find the side lengths of the smaller triangle, and compare them with the sides of triangle ABCABC. What do you notice?

Solution

Midpoints: ABAB gives D(1,3)D(1, 3), BCBC gives E(4,−1)E(4, -1), and ACAC gives F(−1,−2)F(-1, -2).

Smaller triangle:

DE=(4−1)2+(−1−3)2=9+16=5EF=(−1−4)2+(−2−(−1))2=25+1=26DF=(−1−1)2+(−2−3)2=4+25=29\begin{aligned} DE &= \sqrt{(4 - 1)^2 + (-1 - 3)^2} = \sqrt{9 + 16} = 5 \\ EF &= \sqrt{(-1 - 4)^2 + (-2 - (-1))^2} = \sqrt{25 + 1} = \sqrt{26} \\ DF &= \sqrt{(-1 - 1)^2 + (-2 - 3)^2} = \sqrt{4 + 25} = \sqrt{29} \end{aligned}

Triangle ABCABC:

AC=(2−(−4))2+(−6−2)2=36+64=10AB=(6−(−4))2+(4−2)2=104=226BC=(2−6)2+(−6−4)2=116=229\begin{aligned} AC &= \sqrt{(2 - (-4))^2 + (-6 - 2)^2} = \sqrt{36 + 64} = 10 \\ AB &= \sqrt{(6 - (-4))^2 + (4 - 2)^2} = \sqrt{104} = 2\sqrt{26} \\ BC &= \sqrt{(2 - 6)^2 + (-6 - 4)^2} = \sqrt{116} = 2\sqrt{29} \end{aligned}

Each side of the smaller triangle is half the side of ABCABC that it doesn’t touch: DE=5DE = 5 is half of AC=10AC = 10, EF=26EF = \sqrt{26} is half of AB=226AB = 2\sqrt{26}, and DF=29DF = \sqrt{29} is half of BC=229BC = 2\sqrt{29}. (You can check 104=4×26=226\sqrt{104} = \sqrt{4 \times 26} = 2\sqrt{26}.) This is the midsegment property, which you’ll prove on verifying geometric properties.