TITLE: Calculate distance in 3D space
QUESTION [42 upvotes]: Imagine I want to determine the distance between points 0,0,0 and 1,2,3.
How is this calculated?

REPLY [5 votes]: 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)}$