Calculates the magnitude of the vector (x, y, z) as √(x² + y² + z²). For a plane vector, set z to 0.
Explanation
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
x, y, z — the components of the vector
∣v∣ — the magnitude, the length of the arrow
For a vector in the plane, set z to 0. The formula reduces to x2+y2, which is exactly the distance from the origin to the point (x,y).
Example
Take (x,y,z)=(3,4,0).
∣v∣=32+42+02=9+16=25=5
The magnitude is 5.
Notes
Components get squared, so a magnitude is never negative. The vector (−3,−4,0) also has magnitude 5.
The only vector with magnitude 0 is the zero vector, every component of which is 0.
Magnitude carries no direction. To isolate direction, divide each component by the magnitude to get the unit vector (53,54,0), whose magnitude is 1.
Scaling a vector by k scales its magnitude by ∣k∣. A negative k reverses the arrow but leaves the length positive.