lerp

fun lerp(other: Vector2d<U>, t: Double): Vector2d<U>(source)

Linear interpolation (lerp) toward another vector.

Computes: \(\mathbf{v}(t) = (1-t)\mathbf{v}_1 + t\mathbf{v}_2\)

Where \(t \in 0, 1\) is the interpolation parameter:

  • \(t = 0\) returns this vector

  • \(t = 1\) returns the other vector

  • \(t = 0.5\) returns the midpoint

Return

the interpolated vector

Parameters

other

the target vector to interpolate toward

t

the interpolation parameter in range 0, 1