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.