normalize

Normalize a Vector inplace.

@safe @nogc nothrow ref
Vector!(T, N)
normalize
(
T
uint N
)
(
ref return Vector!(T, N) vec
)

Examples

Vec2 v = [5, 0];
v.normalize();
assert(v == Vec2(1, 0));

Meta