# 1.9 Distance between points in three-dimensional Euclidean space

You saw in Section 1.5 that the distance between two points (*x*_{1}, *y*_{1}) and (*x*_{2}, *y*_{2}) in the plane is given by

We can establish a similar formula for the distance between two points in ^{3}, as follows.

Let *P* (*x*_{1}, *y*_{1}, *z*_{1}) and *Q*(*x*_{2}, *y*_{2}, *z*_{2}) be two points in ^{3}. Let *M* be the foot of the perpendicular from *Q* to the plane through *P* that is parallel to the (*x*, *y*)-plane; then *M* has coordinates (*x*_{2}, *y*_{2}, *z*_{1}). Next, let *N* be the point in this plane with coordinates (*x*_{1}, *y*_{2}, *z*_{1}).

Then the triangles *PQM* and *PMN* are both right-angled triangles, with right angles at *M* and *N*, respectively, as shown below.

The length of *PN* is |*y*_{2} − *y*_{1}|, the length of *NM* is |*x*_{2} − *x*_{1}|, and the length of *MQ* is |*z*_{2} − *z*_{1}|. It follows from Pythagoras' Theorem that

*PM*^{2} = *NM*^{2} + *PN*^{2},

so

*PM*^{2} = (*x*_{2} − *x*_{1})^{2} + (*y*_{2} − *y*_{1})^{2}.

*Note:* This part of the discussion is similar to the derivation of the Distance Formula in ^{2} (see Section 1.5).

Using Pythagoras' Theorem again, we obtain

*PQ*^{2} = *PM*^{2} + *MQ*^{2}

so

that is,

## Distance Formula in three-dimensional Euclidean space

The distance between two points (*x*_{1}, *y*_{1}, *z*_{1}) and (*x*_{2}, *y*_{2}, *z*_{2}) in ^{3} is

For example, it follows from this formula that the distance between the points (1, 2, 3) and (4, −2, 15) is

## Example 11

For each of the following pairs of points in ^{3}, find the distance between them.

**(a)**(1, 1, 1) and (4, 1, −3).**(b)**(1, 2, 3) and (3, 0, 3).

### Answer

We use the formula for the distance between two points in ^{3} This gives the following distances.