Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Imagine I want to determine the distance between points 0,0,0 and 1,2,3.

How is this calculated?

share|improve this question
How would you do it in two dimensions? –  JavaMan Jun 1 '11 at 20:00
No idea. For some reason they don't learn us that at school… –  Simon Verbeke Jun 1 '11 at 20:12

3 Answers 3

up vote 7 down vote accepted

By using the the Pythagorean theorem twice, you can show that $d((0,0,0),(1,2,3))=\sqrt{\left(\sqrt{1^2+2^2}\right)^2+3^2}=\sqrt{1^2+2^2+3^2}$.

In general, if you have two points $(x_1, \ldots, x_n)$ and $(y_1, \ldots, y_n)$ in $\mathbb{R}^n$, you can use the Pythagorean theorem $n-1$ times to show that the distance between them is $$\sqrt{\displaystyle\sum_{i=1}^n (x_i -y_i)^2}$$

share|improve this answer

It's Pythagorean theorem, just like with 2D space.

$||[0, 0, 0]-[1, 2, 3]|| = \sqrt{(0-1)^2+(0-2)^2+(0-3)^2} = \sqrt{1+4+9} = \sqrt{14}$

share|improve this answer

Here is an illustration:

3d Pythagorean theorem illustration

You want to find $d = \sqrt{h^2 + z^2}$, where $h = \sqrt{x^2 + y^2}$. So

$d = \sqrt{\sqrt{x^2 + y^2}^2 + z^2} = \sqrt{x^2 + y^2 + z^2}$

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.