![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
Namespace containing mathematic related interfaces.
Murl.Math.BigInteger
Murl.Math.Box
Murl.Math.Cone
Murl.Math.Cylinder
Murl.Math.Easing
Murl.Math.Frustum
Murl.Math.Limits
Murl.Math.Matrix
Murl.Math.MinMax
Murl.Math.Plane
Murl.Math.Quaternion
Murl.Math.Ray
Murl.Math.Rectangle
Murl.Math.Sphere
Murl.Math.StaticMatrix
Murl.Math.StaticVector
Murl.Math.Vector
Definition of e.
Definition of pi.
Definition of two pi.
Definition of halve pi.
Definition of inverse pi.
Definition of inverse 2*pi.
Definition of inverse pi/2.
Definition of degrees to radians factor.
Definition of radians to degrees factor.
Definition of millimeters to centimeters factor.
Definition of centimeters to millimeters factor.
Definition of millimeters to inches factor.
Definition of centimeters to inches factor.
Definition of inches to millimeters factor.
Definition of inches to centimeters factor.
The linear interpolation template function for Double.
Number Lerp(Number startValue, Number endValue, Number t)
startValue | The start value to interpolate. |
endValue | The end value to interpolate. |
t | The parameter to interpolate in range [0 .. 1]. |
Evaluate a cubic bezier curve at a given X value. This function returns the interpolated Y value of a cubic bezier curve defined via four (X,Y) control point pairs and a given target X value. If the target X value is outside the range [x0..x3], it is clamped to that range.
Number CubicBezierAt(Number x0, Number x1, Number x2, Number x3, Number y0, Number y1, Number y2, Number y3, Number x)
x0 | The X value of the starting point (first control point) |
x1 | The X value of the second control point |
x2 | The X value of the third control point |
x3 | The X value of the end point (fourth control point) |
y0 | The Y value of the starting point (first control point) |
y1 | The Y value of the second control point |
y2 | The Y value of the third control point |
y3 | The Y value of the end point (fourth control point) |
x | The target X value |
The interpolation template function calculates the IEnums::Interpolation curve (easing function).
Number Interpolation(Murl.IEnums.Interpolation interpolation, Number x)
interpolation | The interpolation. |
x | The value to interpolate in range [0 .. 1]. |
Get the absolute value.
value | The input value. |
Get the sign of a value.
value | The input value. |
Get the minimum of two values. If both are equivalent, x is returned.
Number Min(Number x, Number y)
x | The 1st value. |
y | The 2nd value. |
Get the minimum of three values. If all are equivalent, x is returned.
Number Min(Number x, Number y, Number z)
x | The 1st value. |
y | The 2nd value. |
z | The 3rd value. |
Get the minimum of four values. If all are equivalent, x is returned.
Number Min(Number x, Number y, Number z, Number w)
x | The 1st value. |
y | The 2nd value. |
z | The 3rd value. |
w | The 4th value. |
Get the maximum of two values. If both are equivalent, x is returned.
Number Max(Number x, Number y)
x | The 1st value. |
y | The 2nd value. |
Get the maximum of three values. If all are equivalent, x is returned.
Number Max(Number x, Number y, Number z)
x | The 1st value. |
y | The 2nd value. |
z | The 3rd value. |
Get the maximum of four values. If all are equivalent, x is returned.
Number Max(Number x, Number y, Number z, Number w)
x | The 1st value. |
y | The 2nd value. |
z | The 3rd value. |
w | The 4th value. |
Clamp a value.
Number Clamp(Number val, Number min, Number max)
val | The value to clamp. |
min | The minimum value. |
max | The maximum value. |
Check if a value is not a number (NaN). The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the result of 0/0.
value | The value to check. |
Check if a value is infinite (either positive infinity or negative infinity).
Boolean IsInfinite(Number value)
value | The value to check. |
Check if a value is finite. A finite value is any floating-point value that is neither infinite nor NaN.
Boolean IsFinite(Number value)
value | The value to check. |
Get the the e number raised to the power of a value.
value | The input value. |
Get the natural logarithm of a value.
value | The input value. |
Get the base 2 logarithm of a value.
value | The input value. |
Get the base 10 logarithm of a value.
value | The input value. |
Get the square root of a value.
value | The input value. |
Get a base raised to the power of an exponent.
Number Pow(Number base, Number exponent)
base | The base input value. |
exponent | The exponent input value. |
Get the remainder of a numerator divided by a denominator.
Number Fmod(Number numerator, Number denominator)
numerator | The numerator input value. |
denominator | The denominator input value. |
Get the integer part and the fractional part of a value.
Number, Number ModF(Number value, Number intPart)
value | The input value. |
intPart | The integer part return value. |
Get the IEEE remainder of a numerator divided by a denominator.
Number Remainder(Number numerator, Number denominator)
numerator | The numerator input value. |
denominator | The denominator input value. |
Get the sine of an angle value.
radAngle | The angle value in radiants. |
Get the cosine of an angle value.
radAngle | The angle value in radiants. |
Get the tangent of an angle value.
radAngle | The angle value in radiants. |
Get the arc sine of a value.
value | The input value. |
Get the arc cosine of a value.
value | The input value. |
Get the arc tangent of a value.
value | The input value. |
Get the arc tangent of y divided by x. The function uses the sign of both arguments to determine the quadrant.
Number ArcTan2(Number y, Number x)
y | The y input value. |
x | The x input value. |
Get the hyperbolic sine of an value.
value | The input value. |
Get the hyperbolic cosine of an value.
value | The input value. |
Get the hyperbolic tangent of an value.
value | The input value. |
Get the hyperbolic arc sine of an value.
Number ArcSinHyp(Number value)
value | The input value. |
Get the hyperbolic arc cosine of an value.
Number ArcCosHyp(Number value)
value | The input value. |
Get the hyperbolic arc tangent of an value.
Number ArcTanHyp(Number value)
value | The input value. |
Round down to an integral value.
value | The input value. |
Round up to an integral value.
value | The input value. |
Round to an integral value, regardless of the rounding direction. Rounding half-way cases away from zero.
value | The input value. |
Check if two values are equal within an epsilon range.
Boolean IsEqual(Number a, Number b, Number epsilon)
a | The 1st value. |
b | The 2nd value. |
epsilon | The epsilon value. |
Convert degrees into radiants.
Number DegToRad(Number degrees)
degrees | The degrees to convert. |
Convert radiants into degrees.
Number RadToDeg(Number radiants)
radiants | The radiants to convert. |
Map an angle into range [-PI .. PI).
angle | The angle value in radiants. |
Calculate the sum of two angles.
Number AddAngle(Number angle1, Number angle2)
angle1 | The first angle value in radiants. |
angle2 | The second angle value in radiants. |
Calculate the difference between two angles.
Number SubAngle(Number angle1, Number angle2)
angle1 | The first angle value in radiants. |
angle2 | The second angle value in radiants. |
Convert a given 32bit float value to 16bit ("half float"), represented by a UInt16 integer.
Integer FloatToHalfFloat(Number value)
value | The 32bit float value to convert |
Convert a given 8bit unsigned integer value to a 16bit floating point value ("half float"), represented by a UInt16 integer. The input value is divided by 255.
Integer IntToHalfFloat(Integer value)
value | The 8bit unsigned integer value to convert |
Convert a given 16bit half float value stored in a UInt16 to a 32bit float value.
Number HalfFloatToFloat(Integer value)
value | The 16bit float value to convert |
Convert a given 16bit half float value stored in a UInt16 to a 8bit unsigned integer value. The output value is multiplied by 255.
Integer HalfFloatToInt(Integer value)
value | The 16bit float value to convert |