# Pythagorean theorem in higher dimensions?

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?).

## migrated from physics.stackexchange.comJul 1 '18 at 1:47

This question came from our site for active researchers, academics and students of physics.

• 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). – Chair Jun 30 '18 at 13:20
• 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. – Solomon Slow Jun 30 '18 at 14:30
• I got the answer i needed, how to delete a question? – Fadel Hossam Manour Jun 30 '18 at 16:08
• See the delete option below your question, below the tags. – sammy gerbil Jun 30 '18 at 18:09
• It is too late to delete the question once the answers are getting upvoted. – joojaa Jun 30 '18 at 20:28

## 4 Answers

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

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

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}$ This is similar to Mr Z.'s answer, but I want to contribute my own version of the figure. 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}.$$

• This is actually exactly the same. – Chase Ryan Taylor Jul 1 '18 at 2:15
• 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. – user573331 Jul 1 '18 at 4:35
• 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. – eternalGoldenBraid Jul 1 '18 at 8:19

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$

• FYI: This is known as de Gua's Theorem. Its further generalizations into higher dimensions relate squares of "measures" of higher dimensional simplices. – Blue Jul 1 '18 at 2:16
• 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. – Josh B. Jul 1 '18 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.