pub fn normalize(v: &mut [f32]) -> f32
Normalizes a vector to unit length (L2 norm = 1).
Returns the original magnitude. If magnitude is zero, returns 0.0 and leaves the vector unchanged.