Math Lab
Home/Class XI/Ch 11/Distance between two points in 3D

Distance between two points in 3D

The distance between (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) in the plane is (x2x1)2+(y2y1)2\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} , just the Pythagorean theorem. In space, the same principle applies, with one extra coordinate.

The formula

For two points P(x1,y1,z1)P(x_1, y_1, z_1) and Q(x2,y2,z2)Q(x_2, y_2, z_2): PQ=(x2x1)2+(y2y1)2+(z2z1)2.\boxed{|PQ| = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}.}

Derivation

Project PP and QQ down to the xyxy-plane: their projections are P(x1,y1,0)P'(x_1, y_1, 0) and Q(x2,y2,0)Q'(x_2, y_2, 0). The distance PQ|P'Q'| in the plane is (x2x1)2+(y2y1)2\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}.

Now consider the right triangle with one leg along PQ|P'Q'| in the xyxy-plane and the other leg vertical of length z2z1|z_2 - z_1|. The hypotenuse PQ|PQ| satisfies PQ2=PQ2+z2z12=(x2x1)2+(y2y1)2+(z2z1)2.\qed|PQ|^2 = |P'Q'|^2 + |z_2 - z_1|^2 = (x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2. \qed

Distance from origin

OP=x12+y12+z12|OP| = \sqrt{x_1^2 + y_1^2 + z_1^2}.

Worked examples

Example 1. Distance between (1,2,3)(1, 2, 3) and (4,6,8)(4, 6, 8).

9+16+25=50=52\sqrt{9 + 16 + 25} = \sqrt{50} = 5\sqrt{2}.

Example 2. Distance from origin to (1,2,2)(1, -2, 2).

1+4+4=3\sqrt{1 + 4 + 4} = 3.

Example 3. Show that (0,0,0),(3,4,0),(0,4,3)(0, 0, 0), (3, 4, 0), (0, 4, 3) form an isosceles triangle.

Sides: AB=9+16+0=5AB = \sqrt{9 + 16 + 0} = 5. AC=0+16+9=5AC = \sqrt{0 + 16 + 9} = 5. BC=9+0+9=18BC = \sqrt{9 + 0 + 9} = \sqrt{18}. AB=ACAB = AC, so isosceles.

Example 4. Find the point on the xx-axis equidistant from (2,3,1)(2, 3, -1) and (4,1,5)(4, -1, 5).

Let the point be (a,0,0)(a, 0, 0).

(a2)2+9+1=(a4)2+1+25\sqrt{(a-2)^2 + 9 + 1} = \sqrt{(a-4)^2 + 1 + 25}.

Square: (a2)2+10=(a4)2+26a24a+4+10=a28a+16+264a=28a=7(a-2)^2 + 10 = (a-4)^2 + 26 \Rightarrow a^2 - 4a + 4 + 10 = a^2 - 8a + 16 + 26 \Rightarrow 4 a = 28 \Rightarrow a = 7.

So (7,0,0)(7, 0, 0).

Example 5. Show that (1,2,3),(1,0,4),(4,1,2)(1, 2, 3), (-1, 0, 4), (4, 1, 2) form a right triangle.

AB2=4+4+1=9AB^2 = 4 + 4 + 1 = 9. AC2=9+1+1=11AC^2 = 9 + 1 + 1 = 11. BC2=25+1+4=30BC^2 = 25 + 1 + 4 = 30.

Check: AB2+AC2=9+11=2030AB^2 + AC^2 = 9 + 11 = 20 \ne 30. Try other combinations: AB2+BC2=3911AB^2 + BC^2 = 39 \ne 11. AC2+BC2=419AC^2 + BC^2 = 41 \ne 9. None equal. So not a right triangle. (I'd correct the example with proper integers.)

Let's use a cleaner case: (0,0,0),(1,0,0),(0,1,0)(0, 0, 0), (1, 0, 0), (0, 1, 0). AB=1,AC=1,BC=2AB = 1, AC = 1, BC = \sqrt{2}. 1+1=2=BC21 + 1 = 2 = BC^2. Right triangle at AA.

Try it yourself

  1. Distance between (1,0,1)(1, 0, 1) and (0,1,0)(0, 1, 0).
  2. Distance between (3,4,5)(-3, 4, 5) and (2,1,0)(2, -1, 0).
  3. Distance from (0,0,0)(0, 0, 0) to (2,2,1)(2, -2, 1).
  4. Find aa such that the distance between (a,1,2)(a, 1, 2) and (3,1,5)(3, 1, 5) is 55.
  5. Show (1,2,3),(2,3,5),(7,0,1)(1, 2, 3), (-2, 3, 5), (7, 0, -1) are collinear.
  6. Find a point on the yy-axis equidistant from (1,2,3)(1, 2, 3) and (2,1,1)(2, 1, 1).
  7. Find a point on the zz-axis at distance 77 from (2,3,1)(2, 3, -1).
  8. Are (0,7,10),(1,6,6),(4,9,6)(0, 7, -10), (1, 6, -6), (4, 9, -6) vertices of a right triangle?
  9. The vertices of a triangle are (2,1,0),(1,1,2),(0,1,3)(2, 1, 0), (-1, -1, 2), (0, 1, 3). Find its perimeter.
  10. Find the equidistant locus of (0,0,0)(0, 0, 0) and (2,0,0)(2, 0, 0).
  11. Find the locus of a point that is at distance 33 from (1,2,1)(1, 2, -1).
  12. The point P(x,y,z)P(x, y, z) is equidistant from (0,0,0)(0, 0, 0) and (1,1,1)(1, 1, 1). Find the equation describing this.

Pitfalls / Tricks

  • Don't forget the third term in the square root.
  • Distance is always non-negative; take the principal square root.
  • For "equidistant" problems, equate squared distances , avoids square roots until you must.
  • Insight. The distance formula is the same Pythagorean theorem we used in 2D, applied twice , once in the xyxy-plane, once between that and the vertical lift.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Distance in 3D
6 questions · pick the best answer
Q1

Q2

Q3

Q4

Q5

Q6