Lerp
From Garry's Mod
Contents |
Description
Performs a linear interpolation from the start number to the end number.
This function provides a very efficient and easy way to smooth out movements.
Arguments
number t
The fraction for finding the result. This number is clamped between 0 and 1.
Arguments
number from
The starting number. The result will be equal to this if delta is 0.
Arguments
number to
The ending number. The result will be equal to this if delta is 1.
Returns
The result of the linear interpolation, (1 - t) * from + t * to.