Graphmath.Vec2.normalize

You're seeing just the function normalize, go back to Graphmath.Vec2 module for more information.

Specs

normalize(vec2()) :: vec2()

normalize(a) finds the unit vector with the same direction as a vec2.

a is the vec2 to be normalized.

It returns a vec2 of the form {normx, normy}.

This is done by dividing each component by the vector's magnitude.