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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

How is this calculated?

share|cite|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
up vote 18 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|cite|improve this answer

Here is an illustration:

3d Pythagorean theorem illustration

You want to find $d$, where $d^2 = h^2 + z^2$, and $h^2 = x^2 + y^2$. So

$d^2 = (x^2 + y^2) + z^2$, and therefore $d = \sqrt{x^2 + y^2 + z^2}$

share|cite|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|cite|improve this answer

The distance between two points in three dimensions is given by:
Given two points: point $a = (x_0, y_0, z_0)$; point $b = (x_1, y_1, z_1)$
The distance is (in units):
$$d = \sqrt{(x_1-x_0)^2 + (y_1-y_0)^2 + (z_1 - z_0)^2}$$
For your given points: point $a = (0,0,0)$; point $b = (1,2,3)$
Using substitution:
$$d = \sqrt{(1-0)^2+(2-0)^2+(3-0)^2}$$
$$d = \sqrt{(1 + 4 + 9)}$$
$$d = \sqrt{(14)}$$
$$d = 3.7$$
Note: if one point, point a, is the origin $$(0,0,0)$$ then the equation reduces to d = $\sqrt{(x^2 + y^2 + z^2)}$

share|cite|improve this answer
For some basic information about writing math at this site see e.g. here, here, here and here. – Chantry Cargill Dec 15 '14 at 20:40
Does d equal exactly 3.7? I get 3.7416573867739413 doing the calculation in Python. – ThorSummoner Feb 9 '15 at 7:15

protected by Zev Chonoles Jan 7 at 17:38

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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