Math Lab
Home/Class X/Ch 7/The distance formula

The distance formula

The first big formula of coordinate geometry tells us how far apart two points are.

Statement

The distance between P=(x1,y1)P = (x_1, y_1) and Q=(x2,y2)Q = (x_2, y_2) is PQ=(x2x1)2+(y2y1)2.\boxed{PQ = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.}

A special case: distance from the origin O=(0,0)O = (0, 0) to P=(x,y)P = (x, y) is x2+y2\sqrt{x^2 + y^2}.

Derivation

Drop perpendiculars from PP and QQ to the xx-axis, meeting it at P=(x1,0)P' = (x_1, 0) and Q=(x2,0)Q' = (x_2, 0). From PP, drop a perpendicular to QQQQ', meeting at R=(x2,y1)R = (x_2, y_1). Then PRQPRQ forms a right triangle with R=90\angle R = 90^\circ (legs parallel to the axes).

  • PR=x2x1PR = |x_2 - x_1| (horizontal distance).
  • QR=y2y1QR = |y_2 - y_1| (vertical distance).
  • PQPQ is the hypotenuse.

By Pythagoras: PQ2=PR2+QR2=(x2x1)2+(y2y1)2PQ^2 = PR^2 + QR^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2. Take square roots. \blacksquare

(We use (x2x1)2=(x1x2)2(x_2 - x_1)^2 = (x_1 - x_2)^2, so the formula is symmetric in PP and QQ.)

Applications

The formula lets us test several geometric properties from coordinates alone.

  • Equality of distances (e.g., a point equidistant from two given points lies on the perpendicular bisector).
  • Identifying types of triangles: compute all three sides; if two are equal, isoceles; if all three, equilateral; if the Pythagorean relation holds, right.
  • Identifying quadrilaterals: compute all four sides and both diagonals; the combinations identify squares, rectangles, rhombi, parallelograms.
  • Verifying a point lies on a circle of given centre and radius (distance from centre equals radius).

The distance formula is robust against permutations: it doesn't matter which point you call "first".

Worked examples

Example 1. Find the distance between (3,2)(3, -2) and (1,4)(-1, 4).

d=(13)2+(4(2))2=16+36=52=213d = \sqrt{(-1 - 3)^2 + (4 - (-2))^2} = \sqrt{16 + 36} = \sqrt{52} = 2\sqrt{13}.

Example 2. Determine if the points (1,5),(2,3),(2,11)(1, 5), (2, 3), (-2, -11) are collinear (using distances).

d(A,B)=1+4=5d(A, B) = \sqrt{1 + 4} = \sqrt{5}. d(B,C)=16+196=212d(B, C) = \sqrt{16 + 196} = \sqrt{212}. d(A,C)=9+256=265d(A, C) = \sqrt{9 + 256} = \sqrt{265}.

If collinear: d(A,B)+d(B,C)=d(A,C)d(A, B) + d(B, C) = d(A, C). Check: 5+2122.236+14.56=16.80\sqrt{5} + \sqrt{212} \approx 2.236 + 14.56 = 16.80. 26516.28\sqrt{265} \approx 16.28. Not equal, so the three points are not collinear.

Example 3. Show that (1,1),(1,3),(3,3),(1,1)(1, -1), (-1, -3), (3, -3), (-1, 1) form an isoceles triangle.

Wait, that's four points. Take the three non-collinear: A=(1,1),B=(1,3),C=(3,3)A = (1, -1), B = (-1, -3), C = (3, -3).

AB=4+4=22AB = \sqrt{4 + 4} = 2\sqrt{2}. BC=16+0=4BC = \sqrt{16 + 0} = 4. CA=4+4=22CA = \sqrt{4 + 4} = 2\sqrt{2}.

AB=CAAB = CA , isoceles.

Example 4. Find a point on the xx-axis equidistant from A=(2,5)A = (-2, 5) and B=(2,3)B = (2, -3).

Let P=(x,0)P = (x, 0). PA2=(x+2)2+25PA^2 = (x + 2)^2 + 25. PB2=(x2)2+9PB^2 = (x - 2)^2 + 9. Set equal: (x+2)2+25=(x2)2+98x+16=16x=2(x + 2)^2 + 25 = (x - 2)^2 + 9 \Rightarrow 8 x + 16 = -16 \Rightarrow x = -2.

So P=(2,0)P = (-2, 0).

Example 5. Verify that (1,7),(4,2),(1,1),(4,4)(1, 7), (4, 2), (-1, -1), (-4, 4) are the vertices of a square.

Label A,B,C,DA, B, C, D in order.

AB=9+25=34AB = \sqrt{9 + 25} = \sqrt{34}. BC=25+9=34BC = \sqrt{25 + 9} = \sqrt{34}. CD=9+25=34CD = \sqrt{9 + 25} = \sqrt{34}. DA=25+9=34DA = \sqrt{25 + 9} = \sqrt{34}.

All sides equal , at least a rhombus. Check diagonals:

AC=4+64=68AC = \sqrt{4 + 64} = \sqrt{68}. BD=64+4=68BD = \sqrt{64 + 4} = \sqrt{68}.

Equal diagonals , together with equal sides, this is a square. ✓

Try it yourself

  1. Distance between (3,4)(-3, 4) and (4,3)(4, -3).
  2. Point (a,b)(a, b) from origin?
  3. Find the point on the yy-axis equidistant from (5,2)(5, -2) and (3,2)(-3, 2).
  4. Show (2,2),(2,1),(5,2)(2, -2), (-2, 1), (5, 2) are vertices of a right triangle.
  5. The point (0,0)(0, 0) is equidistant from (a,0)(a, 0) and (0,a)(0, a). Show distances equal.
  6. Find kk if the distance between (2,3)(2, 3) and (4,k)(4, k) is 55.
  7. Show A(0,5),B(2,3),C(2,3)A(0, 5), B(-2, -3), C(2, -3) form an isoceles triangle.
  8. Are (1,1),(1,1),(3,3)(1, 1), (-1, -1), (-\sqrt{3}, \sqrt{3}) vertices of an equilateral triangle?
  9. Find the centre of a circle passing through (6,6),(3,7),(3,3)(6, -6), (3, -7), (3, 3).
  10. The point P=(x,y)P = (x, y) is equidistant from A=(5,1)A = (5, 1) and B=(1,5)B = (-1, 5). Show 3x=2y3 x = 2 y.

Pitfalls / Insight

  • Always square first, then add, then square-root. Order of operations matters under a radical.
  • Distance is always non-negative. A negative answer is a sign of arithmetic error.
  • For "equidistant from XX and YY", set PX2=PY2PX^2 = PY^2 , the squares are easier than the roots.

Insight. The distance formula is Pythagoras dressed in coordinates. Every metric question in the plane reduces to it.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Distance formula
6 questions · pick the best answer
Q1

Distance between (3,4)(-3, 4) and (4,3)(4, -3):

Q2

Point on yy-axis equidistant from (5,2)(5, -2) and (3,2)(-3, 2):

Q3

Distance from origin to (a,b)(a, b):

Q4

kk if distance between (2,3)(2, 3) and (4,k)(4, k) is 55:

Q5

Sides 34,34,34,34\sqrt{34}, \sqrt{34}, \sqrt{34}, \sqrt{34} and diagonals 68,68\sqrt{68}, \sqrt{68}. Shape:

Q6

Distance formula uses: