Lerp VVV

Name Edit

lerp - returns linear interpolation of two scalars or vectors based on a weight.

Synopsis Edit

vector1 lerp(vector1 a, vector1 b, vector1 w);
vector2 lerp(vector2 a, vector2 b, vector2 w);
vector3 lerp(vector3 a, vector3 b, vector3 w);
vector4 lerp(vector4 a, vector4 b, vector4 w);

Parameters Edit

Vector or scalar to weight; returned when w is zero.
Vector or scalar to weight; returned when w is one.
Vector or scalar weight.

Description Edit

Returns the linear interpolation of a and b based on weight w.

a and b are either both scalars or both vectors of the same length. The weight w may be a scalar or a vector of the same length as a and b. w can be any value (so is not restricted to be between zero and one); if w has values outside the [0,1] range, it actually extrapolates.

lerp returns a when w is zero and returns b when w is one.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.