Magnitude of a Vector

Calculates the magnitude of the vector (x, y, z) as √(x² + y² + z²). For a plane vector, set z to 0.

The magnitude of a vector, also called its length or norm, comes straight from the Pythagorean theorem: square each component, add them, take the square root.

v=x2+y2+z2|\vec{v}| = \sqrt{x^2 + y^2 + z^2}

For a vector in the plane, set zz to 0. The formula reduces to x2+y2\sqrt{x^2 + y^2}, which is exactly the distance from the origin to the point (x,y)(x, y).

Example

Take (x,y,z)=(3,4,0)(x, y, z) = (3, 4, 0).

v=32+42+02=9+16=25=5|\vec{v}| = \sqrt{3^2 + 4^2 + 0^2} = \sqrt{9 + 16} = \sqrt{25} = 5

The magnitude is 5.

Notes