The mathex library exposes more functions to the built-in Lua math library.
The following functions are exposed by this library:
number Distance2D(number x1, number y1, number x2, number y2);
Parameters
x1 - The first coords X axis.
y1 - The first coords Y axis.
x2 - The second coords X axis.
y2 - The second coords Y axis.
Returns
number Distance3D(number x1, number y1, number z1, number x2, number y2, number z2);
Parameters
x1 - The first coords X axis.
y1 - The first coords Y axis.
z1 - The first coords Z axis.
x2 - The second coords X axis.
y2 - The second coords Y axis.
z2 - The second coords Z axis.
Returns
number DegreeToRadian(number deg);
number RadianToDegree(number rad);
number Clamp(number num, number l, number h);
Parameters
num - The number to clamp.
l - The low value to clamp within.
h - The high value to clamp within.
Returns
number Round(number num, number dp);
number ToD3DColor(number a, number r, number g, number b);
Parameters
a - The alpha color.
r - The red color.
g - The green color.
b - The blue color.
Returns