LERP
A value part of the way from one to another.
Syntax
LERP(a,b,t)
| Argument | Meaning |
|---|---|
| a, b | Two numbers, or two positions. |
| t | How far: 0 is a, 1 is b, 0.5 half way; less than 0 or more than 1 goes beyond. |
Result
A number or position.
Examples
In the example drawing:
| Expression | Gives |
|---|---|
LERP(0,10,0.25) |
2.5 |
LERP(P0,P2,0.5) |
[250,150] |
LERP(P0,P1,1/3) |
[166.6667,0] |
LERP(0,10,1/4) |
2 1/2 |
Notes
Between numbers, a fraction for t keeps the result exact, with fractions or feet and inches: LERP(1',2',1/2) is 1'6". The Tween snap mode writes LERP for a fraction and ALONG for a distance.
See also: INVERSELERP, REMAP, LERPFROMEND, ALONG, SMOOTHSTEP.