normalize

function

normalize()

Description

Normalizes the vector

Returns

vec2 New normalized vector otherwise 'self'

Example

vec1 = new Vec2(10, 5);
show_debug_message(vec1.normalize()); // Result: { x : 0.89, y : 0.45 }

Copyright © 2020, eL-Falso. Built on December 14, 2020 using GMDoc.