Functions | |
float | Ln (const float &number) |
Computes natural logarithm of specified number. | |
float | Log (const float &number) |
Computes 10-base logarithm of specified number. | |
void | Div (const int &number, const int ÷r, int "ient, int &remainder) |
This function divides number with specified divider and return quotient and remainder. | |
float | Exp (const float &number) |
Compute e^number. | |
void | SplitFloat (const float &number, float &integerPart, float &floatPart) |
Divides specified number into integer part and float part (part after floating-point comma). | |
float | Pow (const float &base, const float &exponent) |
Computes base^exponent. | |
float | Floor (const float &f) |
Computes the floor of value. | |
float | Ceil (const float &f) |
Computes the ceil of value. | |
BOOL | IsPowerOfTwoINT (const int &x) |
Determines whether integer number is power of two. | |
BOOL | IsPowerOfTwoUINT (const unsigned int &x) |
Determines whether unsigned integer number is power of two. | |
float | Fabs (const float &x) |
Calculates absolute value of floating-point number. | |
int | Abs (const int &x) |
Calculates absolute value of number. | |
float | Sin (const float &angle) |
Calculate sinus of specified angle in radians. | |
float | Asin (const float &x) |
Calculate arc-sinus of specified angle in range <-1,1>. | |
float | Cos (const float &angle) |
Calculate cosinus of specified angle in radians. | |
float | Acos (const float &x) |
Calculate arc-cosinus of specified angle in range <-1,1>. | |
void | SinCos (const float &angle, float &r_sin, float &r_cos) |
Calculate cosinus and sinus for specified angle in radians. | |
float | Tangent (const float &angle) |
Calculate tangent of specified angle in radians. | |
float | ArcTangent (const float &x) |
Computes arcus tangent of given value which must be in range <-1,1>. | |
float | ArcTangent2 (const float &y, const float &x) |
Compute arcus tangent of (y/x) and return result in range <-PI,PI>. | |
float | Cotangent (const float &angle) |
Calculate cotangent of specified angle in radians. | |
float | ArcCotangent (const float &x) |
Computes arcus cotangent of given value which must be in range <-1,1>. | |
float | Sqrt (const float &x) |
Calculate square root. | |
float | InvSqrt (const float &x) |
Calculate inverse square root (1/sqrt). | |
int | MaxInt (int a, int b) |
Returns maximum from two integers. | |
int | MinInt (int a, int b) |
Returns minimum from two integers. | |
Variables | |
const float | PI = 3.1415926535897932384626433832795f |
definition of PI | |
const float | PI_HALF = PI * 0.5f |
half of PI | |
const float | E = 2.7182818284590452353602874713527f |
definition of E |
If application doesn't need speed then standard math routines should be used (from StdMath namespace).
Names of functions are identical with names from NSStdMath, but first letter is uppercase.
|
Calculates absolute value of number.
Definition at line 163 of file FastMath.h. |
|
Calculate arc-cosinus of specified angle in range <-1,1>.
Definition at line 199 of file FastMath.h. |
|
Computes arcus cotangent of given value which must be in range <-1,1>. Its computed as (PI/2) - arctan(x).
Definition at line 261 of file FastMath.h. |
|
Computes arcus tangent of given value which must be in range <-1,1>.
Definition at line 229 of file FastMath.h. References DBGASSERT. |
|
Compute arcus tangent of (y/x) and return result in range <-PI,PI>. If X is 0 then 0 is returned, if both parameters are 0 then 0 is returned.
Definition at line 242 of file FastMath.h. |
|
Calculate arc-sinus of specified angle in range <-1,1>.
Definition at line 181 of file FastMath.h. |
|
Computes the ceil of value.
Definition at line 119 of file FastMath.h. |
|
Calculate cosinus of specified angle in radians.
Definition at line 190 of file FastMath.h. |
|
Calculate cotangent of specified angle in radians.
Definition at line 251 of file FastMath.h. |
|
This function divides number with specified divider and return quotient and remainder. Its fast solution, because computing remainder and quotinent is performed as one instruction.
Definition at line 63 of file FastMath.h. References NSMath::NSStdMath::div(). Here is the call graph for this function: ![]() |
|
Compute e^number.
Definition at line 75 of file FastMath.h. |
|
Calculates absolute value of floating-point number.
Definition at line 152 of file FastMath.h. |
|
Computes the floor of value.
Definition at line 108 of file FastMath.h. |
|
Calculate inverse square root (1/sqrt).
Definition at line 281 of file FastMath.h. |
|
Determines whether integer number is power of two.
Definition at line 130 of file FastMath.h. |
|
Determines whether unsigned integer number is power of two.
Definition at line 141 of file FastMath.h. |
|
Computes natural logarithm of specified number.
Definition at line 41 of file FastMath.h. |
|
Computes 10-base logarithm of specified number.
Definition at line 50 of file FastMath.h. |
|
Returns maximum from two integers.
Definition at line 293 of file FastMath.h. |
|
Returns minimum from two integers.
Definition at line 307 of file FastMath.h. |
|
Computes base^exponent.
Definition at line 97 of file FastMath.h. |
|
Calculate sinus of specified angle in radians.
Definition at line 172 of file FastMath.h. |
|
Calculate cosinus and sinus for specified angle in radians.
Definition at line 210 of file FastMath.h. Referenced by TCameraClassic::Rotate(), and TCameraClassic::RotateAndZoom(). |
|
Divides specified number into integer part and float part (part after floating-point comma). Integer part is still float's type, but can be re-typed to INT value without losing precision.
Definition at line 87 of file FastMath.h. |
|
Calculate square root.
Definition at line 272 of file FastMath.h. Referenced by NSMath::TVector3::Length(), TCameraClassic::Rotate(), and TCameraClassic::RotateAndZoom(). |
|
Calculate tangent of specified angle in radians.
Definition at line 220 of file FastMath.h. |
|
definition of E
Definition at line 35 of file FastMath.h. |
|
definition of PI
Definition at line 33 of file FastMath.h. |
|
half of PI
Definition at line 34 of file FastMath.h. Referenced by ArcCotangent(), TMathTest::ConvEulerAnglesMatrix3(), and TMathTest::ConvEulerAnglesMatrix4(). |