# Distance Formula in Three Dimensions

The distance formula in 3-D space is defined as:

$$|P_1\, P_2| = \sqrt{(x_2- x_1)^2 + (y_2 -y_1)^2 + (z_2- z_1)^2}$$

My question is that if I have 2 points that have negative coordinates, do I have to use the absolute value on all the points?

For example my two points are $\,P(3, -2, -3)\,\,,\,\, Q(7,0,1)$

When I plug in the y and z values of P do I have to use positive 2 and positive 3?

Thanks in advance.

-

## 2 Answers

Do it exactly like it says: $7-3=4$, $0-(-2)=2$, $1-(-3)=4$, so the distance is $$\sqrt{4^2+2^2+4^2}.$$ This turns out to be $\sqrt{36}$, which is $6$.

Another example: Suppose that $(x_1,y_1,z_1)=(-11, 9, -4)$ and $(x_2,y_2,z_2)=(-3, 5,6)$. Then $x_2-x_1=(-3)-(-11)=8$, $y_2-y_1=5-9=-4$, and $z_2-z_1=6-(-4)=10$, so the distance is $\sqrt{8^2+(-4)^2+10^2}$, which is $\sqrt{180}$.

As usual, one has to take care with the minus signs, since slips are all too easy to make.

-

The formula is correct for all real numbers. You don't need absolute value. (Note that $-3$ and $1$ are $4$ units apart, not $2$.)

-