girgit.org

Introduction to Three Dimensional Geometry

How far apart are two points? The distance formula

The big ideaThe distance between two points in space is Pythagoras' theorem used twice: \( PQ = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \).

In simple words

A fly sits in one bottom corner of a room and wants to reach the top corner that is farthest away. The straight path cuts right through the middle of the room. To find how long it is, first find the slanting line across the floor, then use that line and the height of the room to find the long slant through the air. Two right-angled triangles, one after the other.

On a flat page

In two dimensions, the distance between \( (x_1, y_1) \) and \( (x_2, y_2) \) is \( \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \). The two gaps, across and up, are the two short sides of a right-angled triangle, and the distance is its hypotenuse, the long side opposite the right angle. In space there is one more gap to add.

Finding the formula

Take \( P(x_1, y_1, z_1) \) and \( Q(x_2, y_2, z_2) \). Draw planes through P and through Q parallel to the three coordinate planes. They make a rectangular parallelepiped (a cuboid) with PQ as one of its long diagonals. Its edges are the three gaps: \( |x_2 - x_1| \), \( |y_2 - y_1| \) and \( |z_2 - z_1| \).

Walk from P to Q along the box's edges, one direction at a time:

  1. From \( P(x_1, y_1, z_1) \) move parallel to the x-axis to \( R(x_2, y_1, z_1) \). \( PR = |x_2 - x_1| \).
  2. From R move parallel to the y-axis to \( S(x_2, y_2, z_1) \). \( RS = |y_2 - y_1| \).
  3. From S move parallel to the z-axis to \( Q(x_2, y_2, z_2) \). \( SQ = |z_2 - z_1| \).

PR and RS meet at a right angle, so in triangle PRS, \( PS^2 = PR^2 + RS^2 \). SQ points straight up, so it is perpendicular to the whole flat level that holds P, R and S, and in particular to PS. So triangle PSQ has its right angle at S, and \( PQ^2 = PS^2 + SQ^2 \). Put the two together:

\[ PQ^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2 \] \[ PQ = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \]

In words: find the three gaps, square each, add, and take the square root. Squaring removes any minus sign, so it does not matter which point you call P.

If P is the origin, every \( x_1, y_1, z_1 \) is 0, and the distance of \( Q(x, y, z) \) from O is

\[ OQ = \sqrt{x^2 + y^2 + z^2} \]

Guess first: a stick in a box

A box is a cube with edges 1 m long. Guess: what is the longest straight stick that fits inside? 1 m? 1.4 m? 2 m? 3 m?

Commit to a guess here, then stretch the box and watch both right-angled triangles.

See what happens
From one corner to the opposite corner: \( \sqrt{1^2 + 1^2 + 1^2} = \sqrt{3} \approx 1.73 \) m. Many people guess 1.4 m, which is only the diagonal of one face (\( \sqrt{2} \)), or add the edges to get 3 m. A straight line is always shorter than a path along the edges, but longer than any face diagonal. A hall 12 m long, 4 m wide and 3 m high has a long diagonal of \( \sqrt{144 + 16 + 9} = \sqrt{169} = 13 \) m.

Worked examples

Worked example 1

Find the distance between \( A(2, -1, 3) \) and \( B(-4, 1, 6) \).

  1. Gaps: \( x \): \( -4 - 2 = -6 \); \( y \): \( 1 - (-1) = 2 \); \( z \): \( 6 - 3 = 3 \).
  2. Squares: \( 36 + 4 + 9 = 49 \).
  3. \( AB = \sqrt{49} = 7 \) units.

Worked example 2: when the answer is a surd

Find the distance between \( C(0, 5, -2) \) and \( D(3, 1, 4) \).

  1. Gaps: \( 3 \), \( -4 \), \( 6 \).
  2. \( 9 + 16 + 36 = 61 \), so \( CD = \sqrt{61} \) units. 61 has no square factor, so leave it as \( \sqrt{61} \).

Try it. How far is \( (1, 2, -2) \) from the origin?

Answer
\( \sqrt{1 + 4 + 4} = \sqrt{9} = 3 \) units.

Practise it here: read the three gaps off the number lines, then pick the distance. Watch out for minus signs.

For JEE: distance from an axis

The distance of \( P(x, y, z) \) from the z-axis is the distance from P to the point \( (0, 0, z) \) straight across from it, which is \( \sqrt{x^2 + y^2} \). Likewise the distance from the x-axis is \( \sqrt{y^2 + z^2} \) and from the y-axis \( \sqrt{z^2 + x^2} \): leave out the axis's own letter. For \( P(3, 4, 12) \): from O it is 13, from the z-axis 5, from the x-axis \( \sqrt{160} = 4\sqrt{10} \), and from the XY-plane just 12.

Don't mix these up

  • Distance from the z-axis uses \( x \) and \( y \): \( \sqrt{x^2 + y^2} \). Distance from the XY-plane uses only \( z \): \( |z| \).
  • Subtracting a negative adds: the gap from \( -1 \) to \( 1 \) is 2, not 0.

Words to know

Distance formula
\( \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \).
Hypotenuse
The longest side of a right-angled triangle, opposite the right angle.
Rectangular parallelepiped
A box with rectangular faces; a cuboid.
Diagonal
A straight line joining two corners that are not next to each other.
Surd
A square root that is not a whole number, like \( \sqrt{61} \).

What is the distance between \( (1, -2, 3) \) and \( (3, 0, 4) \)?

  1. 5
  2. 3
  3. 9

How far is \( (6, 8, 5) \) from the z-axis?

  1. 10
  2. 5
  3. \( 5\sqrt{5} \)

Does \( PQ \) change if you swap which point is P and which is Q?

  1. Yes, it becomes negative
  2. No, the squares are the same
  3. Yes, it doubles