Module math_extras

Extra functionality for Lua's math library.

Functions

math.clamp (x, min, max) Returns the value x clamped between an upper (max) and lower bounds (min).
math.lerp (from, to, amount) Linearly interpolates values from and to by amount.


Functions

math.clamp (x, min, max)
Returns the value x clamped between an upper (max) and lower bounds (min). Any values comparable by order, that is, with a less than operator, can be passed in.

Parameters:

Returns:

    Vector2, Vector3, Color or number
math.lerp (from, to, amount)
Linearly interpolates values from and to by amount. Equivalent to from + (amount * (to - from)).

Parameters:

Returns:

    Vector2, Vector3, Color, Quat or number
generated by LDoc 1.4.6 Last updated 2023-01-04 08:52:34