When using vector notation in coordinate systems (Cartesian coordinates) we see that the magnitude of a vector in two dimensions is equal to the square root of its Y component squared added to its X component squared (Pythagorean theorem).
But the same calculation is done for a three dimensional vector that has X, Y, and Z components.
Is there a triangle that has four sides? (of course not, but how does this right triangle formula work for a calculation that involves more than two dimensions?).

  • 9
    $\begingroup$ I'm voting to close this question as off-topic for insufficient prior research. A simple google search for 'Pythagoras theorem 3 dimensions' gives several satisfactory answers identical to those below (there are presently 2 of them, both of which are identical as well). $\endgroup$
    – Chair
    Jun 30, 2018 at 13:20
  • 1
    $\begingroup$ The Euclidean distance between two points is defined for Euclidean vector spaces with any number of dimensions. The Euclidean distance is the norm for a Euclidean vector space. $\endgroup$ Jun 30, 2018 at 14:30
  • $\begingroup$ I got the answer i needed, how to delete a question? $\endgroup$ Jun 30, 2018 at 16:08
  • $\begingroup$ See the delete option below your question, below the tags. $\endgroup$ Jun 30, 2018 at 18:09
  • $\begingroup$ It is too late to delete the question once the answers are getting upvoted. $\endgroup$
    – joojaa
    Jun 30, 2018 at 20:28

4 Answers 4


You can think of it as doing the pythagorean theorem twice. Imagine you have the vector (x,y,z) denoted by the red line in the figure below. The magnitude of the green line is given by


and the magnitude of the blue line is $z$. So when you use the pythagorean theorem on the triangle made up of the red, green, and blue lines you get

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

enter image description here


This is similar to Mr Z.'s answer, but I want to contribute my own version of the figure.enter image description here

We are visualizing a vector $x = (x_1,x_2,x_3)$. From the Pythagorean theorem, the length $h$ of the line segment shown in blue is $$ h = \sqrt{x_1^2 + x_2^2}. $$ Using the Pythagorean theorem again, we see that the length of $x$ is $$ \|x\| = \sqrt{h^2 + x_3^2} = \sqrt{x_1^2 + x_2^2 + x_3^2}. $$

  • $\begingroup$ This is actually exactly the same. $\endgroup$ Jul 1, 2018 at 2:15
  • 2
    $\begingroup$ I'll second @ChaseRyanTaylor... there's no point in re-posting. There are now 3 identical answers. It's good that you wanted to add a better image: the answer you mentioned does have a pretty out-of-scale figure. But it would have been better if you had simply suggested an edit on that one, and mentioned in the edit summary that the original image is confusing/misleading. $\endgroup$
    – user573331
    Jul 1, 2018 at 4:35
  • 2
    $\begingroup$ I agree it's the same, but I didn't feel comfortable replacing the image in the other answer, and I thought this image might have some usefulness to other people. If anyone is preparing slides on this topic, for example, they can feel free to use this image. It took me about half an hour to make it. There is little harm in posting it and potentially some value. $\endgroup$ Jul 1, 2018 at 8:19
  • 1
    $\begingroup$ @eternalGoldenBraid I do think your image and use of h variable is clearer, because it helped me a bit grasping the concept immediately. Thanks! $\endgroup$
    – 1d0m3n30
    Jun 26, 2020 at 10:49

A different variation of the Pythagorean theorem in 3D: This one relates areas!

The black lines are perpendicular to each other.


$Area(\Delta ABC)^2 = Area(\Delta OAB)^2 +Area(\Delta OAC)^2 +Area(\Delta OBC)^2 $

  • 3
    $\begingroup$ FYI: This is known as de Gua's Theorem. Its further generalizations into higher dimensions relate squares of "measures" of higher dimensional simplices. $\endgroup$
    – Blue
    Jul 1, 2018 at 2:16
  • $\begingroup$ Thanks. I didn't know it by name. Only by playing around with math in High School. One can also use this fact to derive Heron's formula for the area of a triangle, given the edge lengths. I don't remember how, so it's left as an exercise to the reader. $\endgroup$
    – Josh B.
    Jul 1, 2018 at 2:19

Especially for the purposes of physics, let's not make this more complicated than it has to be. Start with the Pythagorean theorem:

$$h = \sqrt{x^2 + y^2}$$

Now consider the same in three dimensions. Choose at random two of the three vectors, which are by hypothesis both at right angles to the third. Consider the plane those two vectors form, and note that any vector on that plane will likewise be at a right angle to the third. So then add the two vectors, whose lengths are here designated $x$ and $y$, and the length of the vector $h$ you get will be:

$$h = \sqrt{x^2 + y^2}$$

Now, this will be in the same plane as the first two, so it will still be orthogonal to the third vector whose length we'll call $z$. So now add this vector to the third, and the length of the sum will be:

$$r = \sqrt{h^2 + z^2} = \sqrt{\left(\sqrt{x^2+y^2}\right)^2 + z^2} = \sqrt{x^2 + y^2 + z^2}$$

Higher dimensions can be shown by induction.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .