lerpy

function

lerpy(_finish, _amt)

Description

Linearly interpolates between two points. Interpolates between the points self and _finish by the interpolant _amt. The parameter _amt is clamped to the range [0, 1].

Arguments

Name Type Description
_finish vec2 The vector to interpolate to.
_amt real The amount to interpolate.

Returns

vec2 The Interpolated vector.
When _amt = 0, the result will be equal to self. When _amt = 1, the result will be equal to _finish.

Example

//Create:
vec1 = new Vec2(10, 5);
vec2 = new Vec2(400, 400);

//Step:
vec1.lerpy(vec2, .1);

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