|
Functions for dealing with vectors and matrices etc. More...
Modules | |
Vector Math | |
Functions for working with three-dimensional vectors (VectorF/Point3F). | |
Matrix Math | |
Functions for working with matrices (MatrixF, AngAxisF, MatrixRotation, MatrixPosition). | |
Random Numbers | |
Functions for generating random numbers. | |
Functions | |
Point3F | getBoxCenter (Box3F box) |
Get the center point of an axis-aligned box. | |
float | getMax (float v1, float v2) |
Calculate the greater of two specified numbers. | |
float | getMin (float v1, float v2) |
Calculate the lesser of two specified numbers. | |
float | m2Pi () |
Return the value of 2*PI (full-circle in radians). | |
float | mAbs (float v) |
Calculate absolute value of specified value. | |
float | mAcos (float v) |
Calculate the arc-cosine of v. | |
float | mAsin (float v) |
Calculate the arc-sine of v. | |
float | mAtan (float rise, float run) |
Calculate the arc-tangent (slope) of a line defined by rise and run. | |
void | mathInit (...) |
Install the math library with specified extensions. | |
int | mCeil (float v) |
Round v up to the nearest integer. | |
float | mClamp (float v, float min, float max) |
Clamp the specified value between two bounds. | |
float | mCos (float v) |
Calculate the cosine of v. | |
float | mDegToRad (float degrees) |
Convert specified degrees into radians. | |
string | mFloatLength (float v, int precision) |
Formats the specified number to the given number of decimal places. | |
int | mFloor (float v) |
Round v down to the nearest integer. | |
float | mFMod (float v, float d) |
Calculate the remainder of v/d. | |
bool | mIsPow2 (int v) |
Returns whether the value is an exact power of two. | |
float | mLerp (float v1, float v2, float time) |
Calculate linearly interpolated value between two specified numbers using specified normalized time. | |
float | mLog (float v) |
Calculate the natural logarithm of v. | |
float | mPi () |
Return the value of PI (half-circle in radians). | |
float | mPow (float v, float p) |
Calculate b raised to the p-th power. | |
float | mRadToDeg (float radians) |
Convert specified radians into degrees. | |
int | mRound (float v) |
Round v to the nearest integer. | |
float | mSaturate (float v) |
Clamp the specified value between 0 and 1 (inclusive). | |
float | mSin (float v) |
Calculate the sine of v. | |
string | mSolveCubic (float a, float b, float c, float d) |
Solve a cubic equation (3rd degree polynomial) of form a*x^3 + b*x^2 + c*x + d = 0. | |
string | mSolveQuadratic (float a, float b, float c) |
Solve a quadratic equation (2nd degree polynomial) of form a*x^2 + b*x + c = 0. | |
string | mSolveQuartic (float a, float b, float c, float d, float e) |
Solve a quartic equation (4th degree polynomial) of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0. | |
float | mSqrt (float v) |
Calculate the square-root of v. | |
float | mTan (float v) |
Calculate the tangent of v. |
Functions for dealing with vectors and matrices etc.
Point3F getBoxCenter | ( | Box3F | box | ) |
Get the center point of an axis-aligned box.
b | A Box3F, in string format using "minExtentX minExtentY minExtentZ maxExtentX maxExtentY maxExtentZ" |
float getMax | ( | float | v1, | |
float | v2 | |||
) |
Calculate the greater of two specified numbers.
v1 | Input value. | |
v2 | Input value. |
float getMin | ( | float | v1, | |
float | v2 | |||
) |
Calculate the lesser of two specified numbers.
v1 | Input value. | |
v2 | Input value. |
float m2Pi | ( | ) |
Return the value of 2*PI (full-circle in radians).
float mAbs | ( | float | v | ) |
Calculate absolute value of specified value.
v | Input Value. |
float mAcos | ( | float | v | ) |
Calculate the arc-cosine of v.
v | Input Value (in radians). |
float mAsin | ( | float | v | ) |
Calculate the arc-sine of v.
v | Input Value (in radians). |
float mAtan | ( | float | rise, | |
float | run | |||
) |
Calculate the arc-tangent (slope) of a line defined by rise and run.
rise | of line. | |
run | of line. |
void mathInit | ( | ... | ) |
Install the math library with specified extensions.
Possible parameters are:
int mCeil | ( | float | v | ) |
Round v up to the nearest integer.
v | Number to convert to integer. |
float mClamp | ( | float | v, | |
float | min, | |||
float | max | |||
) |
Clamp the specified value between two bounds.
v | Input value. | |
min | Minimum Bound. | |
max | Maximum Bound. |
float mCos | ( | float | v | ) |
Calculate the cosine of v.
v | Input Value (in radians). |
float mDegToRad | ( | float | degrees | ) |
Convert specified degrees into radians.
degrees | Input Value (in degrees). |
string mFloatLength | ( | float | v, | |
int | precision | |||
) |
Formats the specified number to the given number of decimal places.
v | Number to format. | |
precision | Number of decimal places to format to (1-9). |
int mFloor | ( | float | v | ) |
Round v down to the nearest integer.
v | Number to convert to integer. |
float mFMod | ( | float | v, | |
float | d | |||
) |
Calculate the remainder of v/d.
v | Input Value. | |
d | Divisor Value. |
bool mIsPow2 | ( | int | v | ) |
Returns whether the value is an exact power of two.
v | Input value. |
float mLerp | ( | float | v1, | |
float | v2, | |||
float | time | |||
) |
Calculate linearly interpolated value between two specified numbers using specified normalized time.
v1 | Interpolate From Input value. | |
v2 | Interpolate To Input value. | |
time | Normalized time used to interpolate values (0-1). |
float mLog | ( | float | v | ) |
Calculate the natural logarithm of v.
v | Input Value. |
float mPi | ( | ) |
Return the value of PI (half-circle in radians).
float mPow | ( | float | v, | |
float | p | |||
) |
Calculate b raised to the p-th power.
v | Input Value. | |
p | Power to raise value by. |
float mRadToDeg | ( | float | radians | ) |
Convert specified radians into degrees.
radians | Input Value (in radians). |
int mRound | ( | float | v | ) |
Round v to the nearest integer.
v | Number to convert to integer. |
float mSaturate | ( | float | v | ) |
Clamp the specified value between 0 and 1 (inclusive).
v | Input value. |
float mSin | ( | float | v | ) |
Calculate the sine of v.
v | Input Value (in radians). |
string mSolveCubic | ( | float | a, | |
float | b, | |||
float | c, | |||
float | d | |||
) |
Solve a cubic equation (3rd degree polynomial) of form a*x^3 + b*x^2 + c*x + d = 0.
a | First Coefficient. | |
b | Second Coefficient. | |
c | Third Coefficient. | |
d | Fourth Coefficient. |
string mSolveQuadratic | ( | float | a, | |
float | b, | |||
float | c | |||
) |
Solve a quadratic equation (2nd degree polynomial) of form a*x^2 + b*x + c = 0.
a | First Coefficient. | |
b | Second Coefficient. | |
c | Third Coefficient. |
string mSolveQuartic | ( | float | a, | |
float | b, | |||
float | c, | |||
float | d, | |||
float | e | |||
) |
Solve a quartic equation (4th degree polynomial) of form a*x^4 + b*x^3 + c*x^2 + d*x + e = 0.
a | First Coefficient. | |
b | Second Coefficient. | |
c | Third Coefficient. | |
d | Fourth Coefficient. | |
e | Fifth Coefficient. |
float mSqrt | ( | float | v | ) |
Calculate the square-root of v.
v | Input Value. |
float mTan | ( | float | v | ) |
Calculate the tangent of v.
v | Input Value (in radians). |