• Practice
  • About 14 min
  • 5 practice questions

The distance formula

Find the distance between two points on an axis or on a line parallel to an axis, derive the distance formula from the Pythagoras theorem, and use it for any two points in the XY-plane.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Find the distance between two points on an axis or on a line parallel to an axis.
  • Explain how the distance formula comes from the Pythagoras theorem.
  • Use d(A, B) = √[(x₂ − x₁)² + (y₂ − y₁)²] for any two points.

Co-ordinate geometry turns geometry into algebra: every point is a pair of numbers, and lengths, midpoints and directions become calculations. This chapter of the Balbharati Mathematics Part II book has three main tools: the distance formula, the section formula and the slope of a line. We start with distance.

Points on an axis or on a line parallel to an axis

On a number line, the distance between points with co-ordinates x₁ and x₂ (x₂ > x₁) is x₂ − x₁. Points on the X-axis look like (x, 0), so the distance between (−3, 0) and (5, 0) is 5 − (−3) = 8. If a segment is parallel to the Y-axis, both points have the same x co-ordinate and only y changes: the distance between (4, −2) and (4, 7) is 7 − (−2) = 9. In general, take the larger co-ordinate minus the smaller.

The distance formula

Let A(x₁, y₁) and B(x₂, y₂) be any two points. Draw a horizontal line through A and a vertical line through B; they meet at D(x₂, y₁). Then AD = |x₂ − x₁| and BD = |y₂ − y₁|, and △ADB is right-angled at D. By the Pythagoras theorem, AB² = AD² + BD².

Distance formula: d(A, B) = √[(x₂ − x₁)² + (y₂ − y₁)²]. The distance of P(x, y) from the origin is √(x² + y²).

— Distance formula

Using the distance formula

  1. Name the points (x₁, y₁) and (x₂, y₂); either order works.
  2. Find the differences x₂ − x₁ and y₂ − y₁, keeping signs inside brackets.
  3. Square and add Squares are never negative.
  4. Take the square root Simplify the surd if needed.

Worked example 1: whole-number distances

  • P(−2, 3) and Q(4, 11): differences 6 and 8, so PQ = √(36 + 64) = √100 = 10.
  • A(1, −4) and B(−4, 8): differences −5 and 12, so AB = √(25 + 144) = √169 = 13.
  • O(0, 0) and R(−6, 8): OR = √(36 + 64) = 10.

Worked example 2: a surd answer

Find the distance between C(3, 4) and D(−2, 1). Working: x₂ − x₁ = −2 − 3 = −5 and y₂ − y₁ = 1 − 4 = −3. CD = √(25 + 9) = √34. Since (x₂ − x₁)² = (x₁ − x₂)², it does not matter which point is taken first.

Common slips
SlipCorrect way
Subtracting a negative: 4 − (−2) = 24 − (−2) = 6
Squaring −5 as −25(−5)² = 25
Adding under the root before squaringSquare each difference first, then add
Writing √(36 + 64) = 6 + 8√100 = 10

Key takeaways: for points on a line parallel to an axis, subtract the co-ordinates that change. In general, d = √[(x₂ − x₁)² + (y₂ − y₁)²], which is the Pythagoras theorem applied to the horizontal and vertical gaps. Watch the signs of negative co-ordinates.

Check your understanding

  1. 1. What is the distance between (2, 0) and (−7, 0)?

    1. 5
    2. 9
    3. −9
    4. 14
    Show answer

    Answer: B. Both points are on the X-axis, so the distance is the larger x minus the smaller: 2 − (−7) = 9.

  2. 2. What is the distance between (−1, 2) and (5, 10)?

    1. 14
    2. √52
    3. 10
    4. 8
    Show answer

    Answer: C. Differences: 5 − (−1) = 6 and 10 − 2 = 8. Distance = √(36 + 64) = √100 = 10.

  3. 3. How far is the point (5, −12) from the origin?

    1. 7
    2. 17
    3. √119
    4. 13
    Show answer

    Answer: D. Distance from the origin = √(x² + y²) = √(25 + 144) = √169 = 13.

  4. 4. What is the distance between A(3, −2) and B(3, 6)?

    1. 8
    2. 4
    3. 6
    4. √72
    Show answer

    Answer: A. The x co-ordinates are equal, so AB is parallel to the Y-axis and AB = 6 − (−2) = 8.

  5. 5. What is the distance between (2, 1) and (5, 3)?

    1. 5
    2. √13
    3. √5
    4. 13
    Show answer

    Answer: B. Differences 3 and 2, so the distance is √(9 + 4) = √13.

Privacy · Terms · Refunds · Delivery