normalized

Returns a normalized copy of Vector.

@safe @nogc nothrow
Vector!(T, N)
normalized
(
T
uint N
)
(
const auto ref Vector!(T, N) vec
)

Examples

Vec2 v = [200, 0];
assert(v.normalized() == Vec2(1, 0));
assert(v == Vec2(200, 0));

Meta