vector.normalize

Edit

Returns a normalized version of the input vector. This is a vector that points in the same direction as the original, but has a length of 1.

normalized = vector.normalize(v)

Arguments

NameTypeDescription
vvector The vector to normalize.

Returns

NameTypeDescription
normalizedvector The normalized vector.

Notes

When given a zero-length vector, the input vector is returned unchanged.

See also