Game dev
Saved & recent

Magnitude

Also called: vector length, norm

Related terms: scalar, normalization

The length of a vector, written as length(v) or |v|. A vector of (3, 4) has length 5, found with the same rule as the long side of a right triangle.

The magnitude of velocity is speed. Dividing a nonzero vector by its magnitude produces a unit vector. A zero vector has no direction, so handle it before dividing.

length(v) = sqrt(x*x + y*y + z*z)

Further reading
LearnOpenGL: Transformations: vector length
3 4 length 5
A vector of (3, 4) makes a right triangle. Its length is √(3² + 4²) = 5.

View in the full Game dev collection