Linear interpolate two vectors.
Vector A.
Vector B, or a scalar applied to both components.
The amount to interpolate by. Values outside 0 to 1 extrapolate.
Error - When a computed component is NaN or non-finite.
lerp({ x: 0, y: 0 }, { x: 10, y: 10 }, 0.5); // -> { x: 5, y: 5 } Copy
lerp({ x: 0, y: 0 }, { x: 10, y: 10 }, 0.5); // -> { x: 5, y: 5 }
Destination object to store the result.
const result = { x: 0, y: 0 };lerp({ x: 0, y: 0 }, { x: 10, y: 10 }, 0.5, result); // result -> { x: 5, y: 5 } Copy
const result = { x: 0, y: 0 };lerp({ x: 0, y: 0 }, { x: 10, y: 10 }, 0.5, result); // result -> { x: 5, y: 5 }
Linear interpolate two vectors.