Computing magnitude
The magnitude of vector v = (x, y, z) is |v| = √(x² + y² + z²). For 2D vectors, omit the z component.
The unit vector is v/|v|, pointing in the same direction with magnitude 1. Direction angles give the angle to each coordinate axis.
|v| = √(x² + y² + z²)
Euclidean vector magnitude.