The Distance Between Two Points in Three-Dimensional Space

The Distance Between Two Points in Three-Dimensional Space

Recall that if $P(x_1, y_1)$ and $Q(x_2,y_2)$ are points such that $(x_1, y_1,), (x_2, y_2) \in \mathbb{R}^2$ then the distance between $P$ and $Q$ can be computed with the formula $\mathrm{distance} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$. For example, if we wanted to compute the distance between the points $(1, 2)$ and $(-1, 4)$, then using the distance formula for $\mathbb{R}^2$ we obtain that:

(1)
\begin{align} \mathrm{distance} = \sqrt{(-1 - 1)^2 + (4 - 2)^2} = \sqrt{(-2)^2 + (2)^2} = \sqrt{8} \end{align}

We also note that the distance between any two points $P, Q \in \mathbb{R}^2$ is zero if and only if $P$ and $Q$ represent the same point.

In $\mathbb{R}^3$, we can compute the distance between two points $P(x_1, y_1, z_1)$ and $Q(x_2, y_2, z_2)$ in a similar manner.

 Definition 1: If $P(x, y, z)$ and $Q(x, y, z)$ are two points in $\mathbb{R}^3$, then the Distance between $P$ and $Q$ can be computed with the formula $\mathrm{distance} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$.

To show that the distance can be calculated in this manner is not difficult using a geometric argument, however, it is a little messy to illustrate in a two-dimensional picture, so we will omit the proof. We will now look at some relatively simply properties of the distance between two points in $\mathbb{R}^3$.

 Theorem 1: Let $P(x_1, y_1, z_1)$ and $Q(x_2, y_2, z_2)$ be points in $\mathbb{R}^3$, and let $d_{PQ} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$ be the distance between $P$ and $Q$. Then $\forall P, Q \in \mathbb{R}^n$: a) $d_{PQ} ≥ 0$. b) $d_{PQ} = 0$ if and only if $(x_1, y_1, z_1) = (x_2, y_2, z_2)$. c) $d_{PQ} = d_{QP}$.

We will prove a) and b).

• Proof a) We note that $P, Q \in \mathbb{R}^3$ and so the coordinates of $P$ and $Q$ are real numbers. Now we know that for all real numbers $x$ that $\sqrt{x} ≥ 0$. Therefore since the sum $(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2$ is a real number, then $d_{PQ} ≥ 0$.
• Proof b) $\Leftarrow$ Suppose that $d_{PQ} = 0$. Then we have that:
(2)
\begin{align} 0 = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \\ 0 = (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2 \end{align}
• Since for any real numbers $x, y \in \mathbb{R}$, $(x - y)^2 ≥ 0$ we have that $(x_2 - x_1)^2 ≥ 0$, $(y_2 - y_1)^2 ≥ 0$ and $(z_2 - z_1)^2 ≥ 0$. Without loss of generality, suppose that $(x_2 - x_1)^2 > 0$. Then either $(y_2 - y_1)^2 < 0$ or $(z_2 - z_1)^2 < 0$, a contradiction, and so we have that $(x_2 - x_1)^2 = 0$, $(y_2 - y_1)^2 = 0$ and $(z_2 - z_1)^2 = 0$, which implies that $x_1 = x_2$, $y_1 = y_2$, and $z_1 = z_2$ and so $(x_1, y_1, z_1) = (x_2, y_2, z_2)$.
• $\Rightarrow$ Suppose that $(x_1, y_1, z_1) = (x_2, y_2, z_2)$. Then computing the distance between these points we have that:
(3)
\begin{align} d_{PQ} = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \\ d_{PQ} = \sqrt{(x_1 - x_1)^2 + (y_1 - y_1)^2 + (z_1 - z_1)^2} \\ d_{PQ} = \sqrt{0^2 + 0^2 + 0^2} = 0 \end{align}

Example 1

Compute the distance between the points $(1, 2, 3), (4, 5, 6) \in \mathbb{R}^3$.

Applying the distance formula directly we have that:

(4)
\begin{align} \: \mathrm{distance} = \sqrt{(4 - 1)^2 + (5 - 2)^2 + (6 - 3)^2} = \sqrt{3^2 + 3^2 + 3^2} = \sqrt{27} \end{align}

Example 2

Compute the distance between the points $(2, 5, -1), (1, 1, 1) \in \mathbb{R}^3$.

Once again, applying the distance formula directly, we get that:

(5)
\begin{align} \: \mathrm{distance} = \sqrt{(1 - 2)^2 + (1 - 5)^2 + (1 + 1)^2} = \sqrt{(-1)^2 + (-4)^2 + (2)^2} = \sqrt{1 + 16 + 4} = \sqrt{21} \end{align}