Normalize a vector to unit length (magnitude = 1). Returns the zero vector if the input magnitude is effectively zero.
vec2Normalize(vec2(3, 4)); // { x: 0.6, y: 0.8 }vec2Normalize(vec2(0, 0)); // { x: 0, y: 0 } Copy
vec2Normalize(vec2(3, 4)); // { x: 0.6, y: 0.8 }vec2Normalize(vec2(0, 0)); // { x: 0, y: 0 }
Normalize a vector to unit length (magnitude = 1). Returns the zero vector if the input magnitude is effectively zero.