Skip to content

Documentation / Vec2 / lerp

lerp() ​

ts
function lerp(
   v1, 
   v2, 
   time): Vec2;

Defined in: Utils/vec2.ts:224

Performs a linear interpolation between two vectors by a time value.

Parameters ​

v1 ​

Vec2

The start vector.

v2 ​

Vec2

The end vector.

time ​

number

The time value to interpolate by (should be between 0 and 1).

Returns ​

Vec2

A new vector.