math.lerp

Linear interpolation between two numbers.

Usage

math.lerp(from, to, parameter)

Arguments

Name Type Description
from number First bound.
to number Second bound.
parameter number Parameter for the interpolation, often between 0 and 1.

Returns

Examples

local lerped = math.lerp(50, 100, .5);
print(lerped); -- Prints "75"
local lerped = math.lerp(50, 100, 2);
print(lerped); -- Prints "150"

This site uses Just the Docs, a documentation theme for Jekyll.