Skip to content
FutureBlitz

    Install

    Import std.math.scalar

    Lerp

    std.math.scalar

    function

    Public Function Lerp<T>(a: T, b: T, t: T): T

    The value t of the way from a to b: a at 0, b itself at 1, though b - a rounds, and past them outside 0 to 1.

    Examples

    Expect(Lerp(0.0, 10.0, 0.25) == 2.5)
    Expect(InverseLerp(0.0, 10.0, 2.5) == 0.25)
    Expect(Remap(5.0, 0.0, 10.0, 100.0, 200.0) == 150.0)

    std/math/scalar.fb, line 182

    Report an issue with this page or with FutureBlitz on GitHub.