# The Distance Formula in 3 Dimensions

You know that the distance $AB$ between two points in a plane with Cartesian coordinates $A\left({x}_{1},{y}_{1}\right)$ and $B\left({x}_{2},{y}_{2}\right)$ is given by the following formula:

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

In three-dimensional Cartesian space, points have three coordinates each. To find the distance between $A\left({x}_{1},{y}_{1},{z}_{1}\right)$ and $B\left({x}_{2},{y}_{2},{z}_{2}\right)$ , use the formula:

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