Skip to the page
Home Campus
Start free

Length of a Line Segment

Find the length of a line segment from the coordinates of its end points, first from a right-angled triangle drawn on the grid and then by a formula; give the answer as a square root or to 3 significant figures; find an unknown coordinate from a given length; and find perimeters of shapes on a grid.

Before you start

  • In Secondary 2 you found the hypotenuse of a right-angled triangle by Pythagoras' theorem: square the other two sides, add, and take the square root. A length is never negative, and the answer is rounded only at the very end.
  • For example, if the two shorter sides are 33 cm and 44 cm, the hypotenuse cc has c2=32+42=9+16=25,c^2 = 3^2 + 4^2 = 9 + 16 = 25\text{,} so c=25=5c = \sqrt{25} = 5 cm. If c2=34c^2 = 34, then c=34=5.830…=5.83c = \sqrt{34} = 5.830\ldots = 5.83 cm (3 s.f.).
  • You have also solved an equation such as (x−1)2=9(x - 1)^2 = 9 by taking square roots: x−1=3x - 1 = 3 or x−1=−3x - 1 = -3, so x=4x = 4 or x=−2x = -2.

The Length from a Right-Angled Triangle

A line segment ABAB that is neither horizontal nor vertical runs at a slant across the grid, so its length cannot be counted in squares. But it is the longest side of a right-angled triangle: go across from AA along a grid line, then up or down along another grid line to BB. The two grid lines meet at a right angle, so Pythagoras' theorem gives ABAB.

The two shorter sides are easy to find. The horizontal side runs from the xx-coordinate of AA to the xx-coordinate of BB, and the vertical side from the yy-coordinate of AA to the yy-coordinate of BB.

Example 1: The length from a drawn triangle

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

Solution

Draw AA and BB, and the right-angled triangle with ABAB as its longest side. Its right angle is at C(3,1)C(3, 1): across from AA and directly below BB.

The line segment from A(−2, 1) to B(3, 4), with the right-angled triangle under it: the horizontal side from A to C(3, 1) is 5 units and the vertical side from C to B is 3 unitsxy53−3−2−11234−112345OA(−2, 1)B(3, 4)C(3, 1)

Horizontal side: AC=3−(−2)=5AC = 3 - (-2) = 5 units.

Vertical side: CB=4−1=3CB = 4 - 1 = 3 units.

By Pythagoras' theorem, AB2=AC2+CB2=52+32=25+9=34.AB^2 = AC^2 + CB^2 = 5^2 + 3^2 = 25 + 9 = 34\text{.}

AB=34=5.830…=5.83AB = \sqrt{34} = 5.830\ldots = 5.83 units (3 s.f.)

The length of ABAB is 34\sqrt{34} units, or 5.835.83 units correct to 3 significant figures.

The Formula for the Length

Do the same with any two points A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2). The right angle is at (x2,y1)(x_2, y_1). The horizontal side is x2−x1x_2 - x_1 units long (or x1−x2x_1 - x_2, if that is the positive one), and the vertical side is y2−y1y_2 - y_1 units long (or y1−y2y_1 - y_2).

These are differences, and one may come out negative. That does not matter, because each is squared: (−3)2=32=9(-3)^2 = 3^2 = 9. So you need not worry which way round you subtract, and you need not draw the triangle every time.

The line segment from A(x₁, y₁) to B(x₂, y₂), with the right-angled triangle under it: the horizontal side x₂ − x₁ to the corner (x₂, y₁), then the vertical side y₂ − y₁ up to Bxyx₂ − x₁y₂ − y₁−112345678−1123456OA(x₁, y₁)B(x₂, y₂)(x₂, y₁)

The length of a line segment

The length of the line 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}

Either point may be taken as (x1,y1)(x_1, y_1): a difference and its negative have the same square.

Example 2: Using the formula

Find the length of the line segment joining P(−3,2)P(-3, 2) and Q(3,−6)Q(3, -6).

Solution

Take P(−3,2)P(-3, 2) as (x1,y1)(x_1, y_1) and Q(3,−6)Q(3, -6) as (x2,y2)(x_2, y_2).

x2−x1=3−(−3)=6x_2 - x_1 = 3 - (-3) = 6 and y2−y1=−6−2=−8.y_2 - y_1 = -6 - 2 = -8\text{.}

PQ=62+(−8)2=36+64=100=10PQ = \sqrt{6^2 + (-8)^2} = \sqrt{36 + 64} = \sqrt{100} = 10

The −8-8 says that QQ is 88 units below PP. Squared, it gives 6464, the same as 828^2. Put a negative number in brackets before squaring it: (−8)2=64(-8)^2 = 64, but −82-8^2 means −(82)=−64-(8^2) = -64.

The length of PQPQ is 1010 units.

A Square Root or 3 Significant Figures

When the sum of the squares is not a perfect square, the length is a square root that does not work out exactly. Give it in the form the question asks for.

Giving a length

The exact length is the square root, such as 52\sqrt{52} units. Leave the number under the square root sign as it is.

Otherwise, give the length correct to 3 significant figures: work out the square root on a calculator, write down at least four figures, then round.

Round only at the end: never round the sum of the squares or a side before taking the square root.

Example 3: The exact length and the length to 3 s.f.

Find the length of the line segment joining C(−4,−3)C(-4, -3) and D(2,1)D(2, 1). Give your answer (a) as a square root, (b) correct to 3 significant figures.

Solution

x2−x1=2−(−4)=6x_2 - x_1 = 2 - (-4) = 6 and y2−y1=1−(−3)=4.y_2 - y_1 = 1 - (-3) = 4\text{.}

CD=62+42=36+16=52CD = \sqrt{6^2 + 4^2} = \sqrt{36 + 16} = \sqrt{52}

(a) CD=52CD = \sqrt{52} units.

(b) On a calculator, 52=7.2111…\sqrt{52} = 7.2111\ldots The fourth figure is 11, less than 55, so the third figure stays: CD=7.21CD = 7.21 units (3 s.f.).

Note that 36+16\sqrt{36 + 16} is not 6+4=106 + 4 = 10: add the squares first, then take the square root.

(a) CD=52CD = \sqrt{52} units (b) CD=7.21CD = 7.21 units (3 s.f.)

An Unknown Coordinate from a Given Length

If the length is known and one coordinate is not, put everything you know into the formula. Square both sides to remove the square root, then solve the equation by taking square roots. There are usually two answers: the unknown point may lie on either side.

Example 4: Two possible points

The points A(3,−2)A(3, -2) and B(b,1)B(b, 1) are 13\sqrt{13} units apart. Find the possible values of bb.

Solution

Take A(3,−2)A(3, -2) as (x1,y1)(x_1, y_1) and B(b,1)B(b, 1) as (x2,y2)(x_2, y_2).

(b−3)2+(1−(−2))2=13\sqrt{(b - 3)^2 + (1 - (-2))^2} = \sqrt{13}

(b−3)2+9=13\sqrt{(b - 3)^2 + 9} = \sqrt{13}

Square both sides: (b−3)2+9=13(b - 3)^2 + 9 = 13.

Subtract 99 from both sides: (b−3)2=4(b - 3)^2 = 4.

Take square roots: b−3=2b - 3 = 2 or b−3=−2b - 3 = -2.

So b=5b = 5 or b=1b = 1.

Check b=5b = 5: 22+32=13\sqrt{2^2 + 3^2} = \sqrt{13}. Check b=1b = 1: (−2)2+32=13.\sqrt{(-2)^2 + 3^2} = \sqrt{13}\text{.}

Both points lie on the line y=1y = 1, one on each side of AA: (5,1)(5, 1) is 22 units to the right of AA and (1,1)(1, 1) is 22 units to the left, and each is 33 units above.

The two possible points B, (5, 1) and (1, 1), on the line y = 1, each joined to A(3, −2) by a line segment √13 units longxy−11234567−3−2−1123Oy = 1A(3, −2)B(5, 1)B(1, 1)

b=5b = 5 or b=1b = 1

Perimeters on a Grid

The perimeter of a shape with straight sides is the sum of the lengths of its sides. A horizontal or vertical side is found by subtracting one coordinate; a slanting side by the formula. If some lengths are square roots, add the unrounded values on a calculator and round the total at the end.

Example 5: The perimeter of a triangle

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

Triangle ABC with vertices A(−2, −1), B(4, −1) and C(1, 3); AB is horizontalxy−3−2−112345−2−11234OA(−2, −1)B(4, −1)C(1, 3)

Solution

ABAB is horizontal: both ends have yy-coordinate −1-1. So AB=4−(−2)=6AB = 4 - (-2) = 6 units.

BC=(1−4)2+(3−(−1))2=(−3)2+42=9+16=25=5BC = \sqrt{(1 - 4)^2 + (3 - (-1))^2} = \sqrt{(-3)^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5 units.

CA=(−2−1)2+(−1−3)2=(−3)2+(−4)2=9+16=25=5CA = \sqrt{(-2 - 1)^2 + (-1 - 3)^2} = \sqrt{(-3)^2 + (-4)^2} = \sqrt{9 + 16} = \sqrt{25} = 5 units.

Perimeter =6+5+5=16= 6 + 5 + 5 = 16 units.

The perimeter of triangle ABCABC is 1616 units.

Example 6: A perimeter to 3 significant figures

The quadrilateral ABCDABCD has vertices A(−3,1)A(-3, 1), B(2,3)B(2, 3), C(4,−2)C(4, -2) and D(−1,−3)D(-1, -3). Find its perimeter, correct to 3 significant figures.

Quadrilateral ABCD with vertices A(−3, 1), B(2, 3), C(4, −2) and D(−1, −3); none of its sides is horizontal or verticalxy−4−3−2−112345−4−3−2−11234OA(−3, 1)B(2, 3)C(4, −2)D(−1, −3)

Solution

AB=(2−(−3))2+(3−1)2=25+4=29AB = \sqrt{(2 - (-3))^2 + (3 - 1)^2} = \sqrt{25 + 4} = \sqrt{29}

BC=(4−2)2+(−2−3)2=4+25=29BC = \sqrt{(4 - 2)^2 + (-2 - 3)^2} = \sqrt{4 + 25} = \sqrt{29}

CD=(−1−4)2+(−3−(−2))2=25+1=26CD = \sqrt{(-1 - 4)^2 + (-3 - (-2))^2} = \sqrt{25 + 1} = \sqrt{26}

DA=(−3−(−1))2+(1−(−3))2=4+16=20DA = \sqrt{(-3 - (-1))^2 + (1 - (-3))^2} = \sqrt{4 + 16} = \sqrt{20}

Perimeter =29+29+26+20=20.341…= \sqrt{29} + \sqrt{29} + \sqrt{26} + \sqrt{20} = 20.341\ldots (keying in the square roots, unrounded, on a calculator).

To 3 significant figures, the perimeter is 20.320.3 units.

Rounding each side first gives 5.39+5.39+5.10+4.47=20.35,5.39 + 5.39 + 5.10 + 4.47 = 20.35\text{,} which rounds to 20.420.4: wrong in the third figure. Round only the total.

The perimeter of ABCDABCD is 20.320.3 units (3 s.f.).

Common Mistakes

  • Taking the square root of each square and adding: 82+12\sqrt{8^2 + 1^2} is 65=8.06…\sqrt{65} = 8.06\ldots, not 8+1=98 + 1 = 9. Add the squares first.
  • Losing a minus sign: for (−2,3)(-2, 3) and (4,1)(4, 1) the horizontal side is 4−(−2)=64 - (-2) = 6, not 22.
  • Squaring a negative number without brackets: (−3)2=9(-3)^2 = 9. On a calculator, −32-3^2 gives −9-9.
  • Rounding too early. Keep the square roots unrounded and round only the final answer.
  • Giving only one answer for an unknown coordinate. (b−3)2=4(b - 3)^2 = 4 gives b−3=2b - 3 = 2 or b−3=−2b - 3 = -2.

Practice Questions

Work each question on paper before you open its solution. Give lengths that are not exact as a square root and correct to 3 significant figures. The questions get harder as you go.

Question 1

Find the length of the line segment joining each pair of points. (a) (−4,3)(-4, 3) and (5,3)(5, 3) (b) (2,−7)(2, -7) and (2,4)(2, 4)

ShowHide solution

(a) Both points have yy-coordinate 33, so the segment is horizontal. Its length is 5−(−4)=95 - (-4) = 9 units.

(b) Both points have xx-coordinate 22, so the segment is vertical. Its length is 4−(−7)=114 - (-7) = 11 units.

The formula gives the same: 92+02=9\sqrt{9^2 + 0^2} = 9 and 02+112=11\sqrt{0^2 + 11^2} = 11.

(a) 99 units (b) 1111 units

Question 2

Find the length of each line segment. (a) A(1,6)A(1, 6) and B(3,−4)B(3, -4) (b) C(−3,−1)C(-3, -1) and D(−6,1)D(-6, 1) (c) P(0,0)P(0, 0) and Q(5,12)Q(5, 12)

ShowHide solution

(a) AB=(3−1)2+(−4−6)2=22+(−10)2=4+100=104=10.198…AB = \sqrt{(3 - 1)^2 + (-4 - 6)^2} = \sqrt{2^2 + (-10)^2} = \sqrt{4 + 100} = \sqrt{104} = 10.198\ldots

(b) CD=(−6−(−3))2+(1−(−1))2=(−3)2+22=9+4=13=3.605…CD = \sqrt{(-6 - (-3))^2 + (1 - (-1))^2} = \sqrt{(-3)^2 + 2^2} = \sqrt{9 + 4} = \sqrt{13} = 3.605\ldots

(c) PQ=52+122=25+144=169=13PQ = \sqrt{5^2 + 12^2} = \sqrt{25 + 144} = \sqrt{169} = 13

(a) 104=10.2\sqrt{104} = 10.2 units (3 s.f.) (b) 13=3.61\sqrt{13} = 3.61 units (3 s.f.) (c) 1313 units

Question 3

The points EE and FF are marked on the grid. Read their coordinates and find the length of EFEF.

The points E and F on a grid, joined by a line segmentxy−4−3−2−11234−3−2−112OEF
ShowHide solution

From the grid, EE is (−3,−2)(-3, -2) and FF is (3,1)(3, 1).

EF=(3−(−3))2+(1−(−2))2=62+32=36+9=45=6.708…EF = \sqrt{(3 - (-3))^2 + (1 - (-2))^2} = \sqrt{6^2 + 3^2} = \sqrt{36 + 9} = \sqrt{45} = 6.708\ldots

E(−3,−2)E(-3, -2), F(3,1)F(3, 1); EF=45=6.71EF = \sqrt{45} = 6.71 units (3 s.f.)

Question 4

Ravi finds the length of the line segment joining (−1,2)(-1, 2) and (3,−1)(3, -1) like this: (3−1)2+(−1−2)2=4+9=13.\sqrt{(3 - 1)^2 + (-1 - 2)^2} = \sqrt{4 + 9} = \sqrt{13}\text{.} Explain his mistake and find the correct length.

ShowHide solution

He lost the minus sign of −1-1: the horizontal difference is 3−(−1)=3+1=4,3 - (-1) = 3 + 1 = 4\text{,} not 3−1=23 - 1 = 2.

Length =42+(−3)2=16+9=25=5= \sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5 units.

He worked out 3−13 - 1 instead of 3−(−1)3 - (-1). The length is 55 units.

Question 5

The points P(1,k)P(1, k) and Q(7,2)Q(7, 2) are 1010 units apart. Find the possible values of kk.

ShowHide solution

(7−1)2+(2−k)2=10\sqrt{(7 - 1)^2 + (2 - k)^2} = 10

Square both sides: 36+(2−k)2=10036 + (2 - k)^2 = 100, so (2−k)2=64(2 - k)^2 = 64.

Take square roots: 2−k=82 - k = 8 or 2−k=−82 - k = -8.

So k=−6k = -6 or k=10k = 10.

Check k=−6k = -6: 62+82=100=10.\sqrt{6^2 + 8^2} = \sqrt{100} = 10\text{.} Check k=10k = 10: 62+(−8)2=100=10.\sqrt{6^2 + (-8)^2} = \sqrt{100} = 10\text{.}

k=−6k = -6 or k=10k = 10

Question 6

The point B(t,−1)B(t, -1) lies to the right of the yy-axis, and its distance from A(−2,3)A(-2, 3) is 55 units. Find the value of tt.

ShowHide solution

(t−(−2))2+(−1−3)2=5,\sqrt{(t - (-2))^2 + (-1 - 3)^2} = 5\text{,} so (t+2)2+16=25(t + 2)^2 + 16 = 25.

(t+2)2=9(t + 2)^2 = 9, so t+2=3t + 2 = 3 or t+2=−3t + 2 = -3: t=1t = 1 or t=−5t = -5.

BB is to the right of the yy-axis, so its xx-coordinate is positive: t=1t = 1.

Check: 32+(−4)2=25=5.\sqrt{3^2 + (-4)^2} = \sqrt{25} = 5\text{.}

t=1t = 1

Question 7

Triangle ABCABC has vertices A(1,3)A(1, 3), B(−1,−1)B(-1, -1) and C(4,1)C(4, 1). (a) Find the length of each side, and show that the triangle is scalene. (b) Find its perimeter, correct to 3 significant figures.

ShowHide solution

(a) AB=(−1−1)2+(−1−3)2=4+16=20AB = \sqrt{(-1 - 1)^2 + (-1 - 3)^2} = \sqrt{4 + 16} = \sqrt{20}

BC=(4−(−1))2+(1−(−1))2=25+4=29BC = \sqrt{(4 - (-1))^2 + (1 - (-1))^2} = \sqrt{25 + 4} = \sqrt{29}

AC=(4−1)2+(1−3)2=9+4=13AC = \sqrt{(4 - 1)^2 + (1 - 3)^2} = \sqrt{9 + 4} = \sqrt{13}

The three lengths are all different, so the triangle is scalene.

(b) Perimeter =20+29+13=13.462…= \sqrt{20} + \sqrt{29} + \sqrt{13} = 13.462\ldots

(a) AB=20AB = \sqrt{20}, BC=29BC = \sqrt{29}, AC=13AC = \sqrt{13} units: all different, so scalene. (b) 13.513.5 units (3 s.f.)

Question 8

The kite KLMNKLMN has vertices K(0,4)K(0, 4), L(3,0)L(3, 0), M(0,−2)M(0, -2) and N(−3,0)N(-3, 0). Find its perimeter, correct to 3 significant figures.

The kite KLMN with vertices K(0, 4), L(3, 0), M(0, −2) and N(−3, 0)xy−4−3−2−11234−3−2−112345OK(0, 4)L(3, 0)M(0, −2)N(−3, 0)
ShowHide solution

KL=(3−0)2+(0−4)2=9+16=25=5KL = \sqrt{(3 - 0)^2 + (0 - 4)^2} = \sqrt{9 + 16} = \sqrt{25} = 5

LM=(0−3)2+(−2−0)2=9+4=13LM = \sqrt{(0 - 3)^2 + (-2 - 0)^2} = \sqrt{9 + 4} = \sqrt{13}

MN=(−3−0)2+(0−(−2))2=9+4=13MN = \sqrt{(-3 - 0)^2 + (0 - (-2))^2} = \sqrt{9 + 4} = \sqrt{13}

NK=(0−(−3))2+(4−0)2=9+16=25=5NK = \sqrt{(0 - (-3))^2 + (4 - 0)^2} = \sqrt{9 + 16} = \sqrt{25} = 5

Perimeter =5+13+13+5=17.211…= 5 + \sqrt{13} + \sqrt{13} + 5 = 17.211\ldots

The perimeter is 17.217.2 units (3 s.f.).

Question 9

A map is drawn with axes in kilometres. A delivery drone flies in straight lines from its base B(−3,2)B(-3, 2) to a block of flats F(5,8)F(5, 8), then to a clinic C(9,5)C(9, 5), and then straight back to BB. Find the total distance it flies, correct to 3 significant figures.

ShowHide solution

BF=(5−(−3))2+(8−2)2=64+36=100=10BF = \sqrt{(5 - (-3))^2 + (8 - 2)^2} = \sqrt{64 + 36} = \sqrt{100} = 10 km

FC=(9−5)2+(5−8)2=16+9=25=5FC = \sqrt{(9 - 5)^2 + (5 - 8)^2} = \sqrt{16 + 9} = \sqrt{25} = 5 km

CB=(−3−9)2+(2−5)2=144+9=153=12.369…CB = \sqrt{(-3 - 9)^2 + (2 - 5)^2} = \sqrt{144 + 9} = \sqrt{153} = 12.369\ldots km

Total =10+5+12.369…=27.369…= 10 + 5 + 12.369\ldots = 27.369\ldots km

The drone flies 27.427.4 km (3 s.f.).

Question 10

On a school field, positions are given by coordinates in metres, with the coach at the origin. Aisha stands at (12,−5)(12, -5) and Ben stands at (−9,10)(-9, 10). Who is closer to the coach, and by how much? Give your answer correct to 3 significant figures.

ShowHide solution

Aisha: 122+(−5)2=144+25=169=13\sqrt{12^2 + (-5)^2} = \sqrt{144 + 25} = \sqrt{169} = 13 m.

Ben: (−9)2+102=81+100=181=13.4536…\sqrt{(-9)^2 + 10^2} = \sqrt{81 + 100} = \sqrt{181} = 13.4536\ldots m.

Difference =13.4536…−13=0.4536…= 13.4536\ldots - 13 = 0.4536\ldots m. The fourth figure is 66, so the third figure goes up: 0.4540.454 m.

Aisha is closer, by 0.4540.454 m (3 s.f.).

Question 11

The points are A(2,1)A(2, 1), B(5,5)B(5, 5) and C(k,1)C(k, 1), where CC is not the same point as AA. Given that BC=ABBC = AB, find the value of kk.

ShowHide solution

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

BC=(k−5)2+(1−5)2=5,BC = \sqrt{(k - 5)^2 + (1 - 5)^2} = 5\text{,} so (k−5)2+16=25(k - 5)^2 + 16 = 25 and (k−5)2=9(k - 5)^2 = 9.

k−5=3k - 5 = 3 or k−5=−3k - 5 = -3: k=8k = 8 or k=2k = 2.

If k=2k = 2, then CC is (2,1)(2, 1), which is the point AA. So k=8k = 8.

Check: BC=(8−5)2+(1−5)2=9+16=5.BC = \sqrt{(8 - 5)^2 + (1 - 5)^2} = \sqrt{9 + 16} = 5\text{.}

k=8k = 8

Key Points

  • A slanting line segment is the longest side of a right-angled triangle whose other two sides lie along grid lines; Pythagoras' theorem gives its length.
  • The length of the line segment joining (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is (x2−x1)2+(y2−y1)2.\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\text{.}
  • Either point may come first: each difference is squared. Put negative numbers in brackets.
  • Give the exact length as a square root, such as 52\sqrt{52} units, or round it to 3 significant figures at the end.
  • An unknown coordinate from a given length: square both sides, then take square roots. There are usually two answers.
  • A perimeter is the sum of the side lengths: add the unrounded values and round the total.

Previous lesson4.1 Gradient of a Line Through Two Points Next lesson4.3 Finding the Equation of a Line from Its Graph

All Secondary 3 (Grade 9) lessons

Home Campus has lessons for Primary 3 to Secondary 4, and practice questions with worked solutions and worksheets for Primary 3 to Secondary 2. Register free to practise and keep track of progress.

This lesson follows the Singapore Secondary 3 syllabus and was checked question by question before it was published. Spotted a mistake? Tell us.