Distance Formula/3 Dimensions

Theorem
The distance $d$ between two points $A = \left({x_1, y_1, z_1}\right)$ and $B = \left({x_2, y_2, z_2}\right)$ in a Cartesian space of 3 dimensions is:
 * $d = \sqrt{\left({x_1 - x_2}\right)^2 + \left({y_1 - y_2}\right)^2 + \left({z_1 - z_2}\right)^2}$

Proof

 * DistanceFormula3D.png

Let $d$ be the distance to be found between $A = \left({x_1, y_1, z_1}\right)$ and $B = \left({x_2, y_2, z_2}\right)$.

Let the points $C$ and $D$ be defined as:


 * $C = \left({x_2, y_1, z_1}\right)$
 * $D = \left({x_2, y_2, z_1}\right)$

Let $d'$ be the distance between $A$ and $D$.

From Distance Formula, it can be seen that:
 * $d' = \sqrt{\left({x_1 - x_2}\right)^2 + \left({y_1 - y_2}\right)^2}$

We note that $\triangle ADB$ is a right triangle.

Thus by Pythagoras's Theorem:
 * $AB^2 = AD^2 + DB^2$

Thus:

and so:
 * $d = \sqrt{\left({x_1 - x_2}\right)^2 + \left({y_1 - y_2}\right)^2 + \left({z_1 - z_2}\right)^2}$

as it was to be proved.