# What is the distance between (0, 0, 8)  and (9, 2, 0) ?

Dec 4, 2015

The distance is $\sqrt{149}$

#### Explanation:

The distance between two points
$\left({x}_{1} , {y}_{1} , {z}_{1}\right)$
and
$\left({x}_{2} , {y}_{2} , {z}_{2}\right)$
in ${\mathbb{R}}^{3}$ (three dimensions) is given by

$\text{distance} = \sqrt{{\left({x}_{2} - {x}_{1}\right)}^{2} + {\left({y}_{2} - {y}_{1}\right)}^{2} + {\left({z}_{2} - {z}_{1}\right)}^{2}}$

Applying it to the problem at hand, we get the distance between $\left(0 , 0 , 8\right)$ and $\left(9 , 2 , 0\right)$ as

$\text{distance} = \sqrt{{\left(9 - 0\right)}^{2} + {\left(2 - 0\right)}^{2} + {\left(0 - 8\right)}^{2}} = \sqrt{81 + 4 + 64} = \sqrt{149}$

.
.
.

The following is an explanation as to where the distance formula comes from, and is not necessary for understanding the above solution.

The distance formula given above looks suspiciously similar to the distance formula in ${\mathbb{R}}^{2}$ (two dimensions):
$\text{distance} = \sqrt{{\left({x}_{2} - {x}_{1}\right)}^{2} + {\left({y}_{2} - {y}_{1}\right)}^{2}}$
which comes from a simple application of the Pythagorean theorem, by drawing a right triangle between two points with the legs parallel to the $x$ and $y$ axes.

It turns out, the ${\mathbb{R}}^{3}$ version can be derived in a similar manner. If we use (at most) 3 lines to connect two points, going parallel to the $x$, $y$, and $z$ axes, we get a box with the points as opposite corners. So, let's figure out how to calculate the distance across the diagonal of a box. We are trying to figure out the length of the red line $\textcolor{red}{A D}$
As this is the hypotenuse of the triangle $A B D$, from the Pythagorean theorem:
${\left(\textcolor{red}{A D}\right)}^{2} = {\left(A B\right)}^{2} + {\left(\textcolor{b l u e}{B C}\right)}^{2}$

$\implies \textcolor{red}{A D} = \sqrt{{\left(A B\right)}^{2} + {\left(\textcolor{b l u e}{B C}\right)}^{2}} \text{ (i)}$

Unfortunately, we don't have the length of $\textcolor{b l u e}{B D}$ as a given. To get it, we must again apply the Pythagorean theorem, this time to the triangle $B C D$.

${\left(\textcolor{b l u e}{B D}\right)}^{2} = {\left(B C\right)}^{2} + {\left(C D\right)}^{2} \text{ (ii)}$

As we only need the square of $\textcolor{b l u e}{B D}$, we can now substitute $\left(\text{ii}\right)$ into $\left(\text{i}\right)$:

$\textcolor{red}{A D} = \sqrt{{\left(A B\right)}^{2} + {\left(B C\right)}^{2} + {\left(C D\right)}^{2}}$

Finally, if we have $A$ at $\left({x}_{1} , {y}_{1} , {z}_{1}\right)$ and $D$ at $\left({x}_{2} , {y}_{2} , {z}_{2}\right)$, then we have the lengths
$C D = | {x}_{2} - {x}_{1} |$
$B C = | {y}_{2} - {y}_{1} |$
$A B = | {z}_{2} - {z}_{1} |$

Substituting these into the the above gives us the desired result.

As an extra note, while we can only easily do geometric proofs in up to 3 dimensions, mathematicians have generalized distance in ${\mathbb{R}}^{n}$ ($n$ dimensions). The distance between
$\left({x}_{1} , {x}_{2} , \ldots , {x}_{n}\right)$ and $\left({y}_{1} , {y}_{2} , \ldots , {y}_{n}\right)$ is defined as

$\sqrt{{\sum}_{k = 1}^{n} {\left({y}_{k} - {x}_{k}\right)}^{2}}$

which matches the pattern from ${\mathbb{R}}^{2}$ and ${\mathbb{R}}^{3}$.