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. | |
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. | |
float | sqrt (const float &x) |
Calculate square root. | |
float | invSqrt (const float &x) |
Calculate inverse square root (1/sqrt). | |
float | rcp (const float &x) |
Compute reciprocal ( 1 / x ) of input value. | |
int | maxInt (int a, int b) |
Returns maximum from two integers. | |
int | minInt (int a, int b) |
Returns minimum from two integers. | |
BOOL | compareFloat (const float &val1, const float &val2, const float &delta) |
Compare two float values with fiven tolerancy. | |
Variables | |
const float | PI = 3.1415926535897932384626433832795f |
definition of PI | |
const float | PI_2 = 2.0f *3.1415926535897932384626433832795f |
definition of PI*2 | |
const float | PI_HALF = PI * 0.5f |
half of PI | |
const float | PI_INV = (1.0f / PI) |
inverse number to PI ... 1 / PI | |
const float | PI_2_INV = (0.5f / PI) |
inverse number to PI*2 ... 1 / PI*2 | |
const float | E = 2.7182818284590452353602874713527f |
definition of E | |
const float | FLOAT_INFINITY = 1e35f |
maximal value for our float values |
Names of functions are identical with names from NSFastMath, but first letter is lowercase.
|
Calculates absolute value of number.
Definition at line 168 of file StdMath.h. Referenced by TRendererCreatorHelper::GetClosestResolution(). |
|
Calculate arc-cosinus of specified angle in range <-1,1>.
Definition at line 204 of file StdMath.h. Referenced by NSMath::TQuaternion::GetAngle(), NSMath::TQuaternion::Ln(), NSMath::TSolvers::RootsCubicReal(), NSMath::TQuaternion::Slerp(), NSMath::TQuaternion::SlerpCompute(), NSMath::TQuaternion::SlerpFast(), and NSMath::TQuaternion::SlerpFastCompute(). |
|
Computes arcus cotangent of given value. Its computed as (PI/2) - arctan(x).
Definition at line 263 of file StdMath.h. References PI_HALF. |
|
Computes arcus tangent of given value.
|
|
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 244 of file StdMath.h. Referenced by NSMath::TEulerAngles::Set(). |
|
Calculate arc-sinus of specified angle in range <-1,1>.
Definition at line 186 of file StdMath.h. Referenced by NSMath::TEulerAngles::Set(). |
|
Computes the ceil of value.
|
|
Compare two float values with fiven tolerancy.
Definition at line 333 of file StdMath.h. References fabs(). Referenced by TMathTest::CalcAABBoxLineSegmentProjection(), TMathTest::CalcLineSegment2DVector2DProjection(), NSMath::TLine2D::Compare(), NSMath::TCircle2D::Compare(), NSMath::TMatrix3::IsOrthonormalBasis(), NSMath::TMatrix3::IsSymmetrical(), and NSMath::TTriangle::PointBarycentricCoords(). Here is the call graph for this function: ![]() |
|
Calculate cosinus of specified angle in radians.
Definition at line 195 of file StdMath.h. Referenced by NSRandom::TRandomNormal::Random(), NSMath::TSolvers::RootsCubicReal(), and NSMath::TEulerAngles::Set(). |
|
Calculate cotangent of specified angle in radians.
Definition at line 253 of file StdMath.h. Referenced by NSMath::TMatrix4::PerspectiveFovRH(). |
|
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 68 of file StdMath.h. Referenced by NSMath::NSFastMath::Div(), and NSMath::TSolvers::RootsQuadraticReal(). |
|
Compute e^number.
Definition at line 80 of file StdMath.h. Referenced by NSMath::TBox::AddPoint(). |
|
|
Computes the floor of value.
Definition at line 113 of file StdMath.h. Referenced by NSMath::TEulerAngles::NormalizeTo_0_PI2(). |
|
Calculate inverse square root (1/sqrt).
Definition at line 281 of file StdMath.h. Referenced by NSMath::TVector4::DotDenormalized(), NSMath::TVector3::DotDenormalized(), NSMath::TVector2D::DotDenormalized(), NSMath::TQuaternion::GetInverse(), NSMath::TQuaternion::Inverse(), NSMath::TQuaternion::Ln(), NSMath::TSolvers::Matrix3CM_RowEcholonForm_Householder(), NSMath::TQuaternion::MultiplyLeft(), NSMath::TQuaternion::MultiplyRight(), NSMath::TVector3::NormalizeFast(), NSMath::TVector2D::NormalizeFast(), NSMath::TQuaternion::NormalizeFast(), NSMath::TQuaternion::NormalizePrecise(), NSMath::TSolvers::RootsCubicReal(), NSMath::TQuaternion::Set(), and NSMath::TLine::SetFromPoints(). |
|
Determines whether integer number is power of two.
|
|
Determines whether unsigned integer number is power of two.
|
|
Computes natural logarithm of specified number.
|
|
Computes 10-base logarithm of specified number.
Definition at line 55 of file StdMath.h. Referenced by NSMeshes::TDeclarationManager::CreateDeclarationManager(), NSShaders::TPixelShaderManager::CreatePixelShaderManager(), TTextureManager::CreateTextureManager(), NSShaders::TVertexShaderManager::CreateVertexShaderManager(), TGlobalsMath::Destroy(), TGlobalsGraphic::Destroy(), NSMeshes::TDeclarationManager::DestroyDeclarationManager(), NSShaders::TPixelShaderManager::DestroyPixelShaderManager(), NSMeshes::TMeshManager::DestroyRendererResources(), TTextureManager::DestroyTextureManager(), NSShaders::TVertexShaderManager::DestroyVertexShaderManager(), TGlobalsMath::Initialize(), TGlobalsGraphic::Initialize(), NSMeshes::TDeclarationManager::Initialize(), NSMeshes::TMeshManager::LoadRendererResources(), NSRandom::TRandomExponential::Random(), and NSRandom::TRandomNormal::Random(). |
|
Returns maximum from two integers.
|
|
Returns minimum from two integers.
|
|
Computes base^exponent.
Definition at line 102 of file StdMath.h. Referenced by NSMath::TSolvers::RootsCubicReal(). |
|
Compute reciprocal ( 1 / x ) of input value.
|
|
Calculate sinus of specified angle in radians.
Definition at line 177 of file StdMath.h. Referenced by NSMath::TQuaternion::Exp(), NSMath::TQuaternion::Slerp(), NSMath::TQuaternion::SlerpCompute(), NSMath::TQuaternion::SlerpFast(), and NSMath::TQuaternion::SlerpFastCompute(). |
|
Calculate cosinus and sinus for specified angle in radians.
Definition at line 215 of file StdMath.h. Referenced by NSMath::TQuaternion::Exp(), NSMath::TVector2D::Rotate(), NSMath::TRay2D::Rotate(), NSMath::TLineSegment2D::Rotate(), NSMath::TLine2D::Rotate(), NSMath::TBox2D::Rotate(), NSMath::TMatrix4::RotateAroundAxis(), NSMath::TMatrix3::RotateAroundAxis(), NSMath::TBox2D::RotateAroundCenter(), NSMath::TRay2D::RotateAroundPoint(), NSMath::TLineSegment2D::RotateAroundPoint(), NSMath::TLine2D::RotateAroundPoint(), NSMath::TBox2D::RotateAroundPoint(), NSMath::TTriangle::RotateAroundX(), NSMath::TRay::RotateAroundX(), NSMath::TLineSegment::RotateAroundX(), NSMath::TLine::RotateAroundX(), NSMath::TBox::RotateAroundX(), NSMath::TTriangle::RotateAroundY(), NSMath::TRay::RotateAroundY(), NSMath::TLineSegment::RotateAroundY(), NSMath::TLine::RotateAroundY(), NSMath::TBox::RotateAroundY(), NSMath::TTriangle::RotateAroundZ(), NSMath::TRay::RotateAroundZ(), NSMath::TLineSegment::RotateAroundZ(), NSMath::TLine::RotateAroundZ(), NSMath::TBox::RotateAroundZ(), NSMath::TVector3::RotateX(), NSMath::TMatrix4::RotateX(), NSMath::TMatrix3::RotateX(), NSMath::TMatrix4::RotateXTran(), NSMath::TVector3::RotateY(), NSMath::TMatrix4::RotateY(), NSMath::TMatrix3::RotateY(), NSMath::TMatrix4::RotateYTran(), NSMath::TVector3::RotateZ(), NSMath::TMatrix4::RotateZ(), NSMath::TMatrix3::RotateZ(), NSMath::TMatrix4::RotateZTran(), NSMath::TQuaternion::Set(), NSMath::TBox2D::SetAngle(), NSMath::TEulerAngles::ToMatrix3(), and NSMath::TEulerAngles::ToMatrix4(). |
|
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.
|
|
Calculate square root.
Definition at line 272 of file StdMath.h. Referenced by NSMath::TSphere::AddPoint(), NSMath::TCircle2D::AddPoint(), NSMath::TTriangle::Area(), NSMath::TVector3::CrossScalar(), NSMath::TRay2D::Distance(), NSMath::TLineSegment2D::Distance(), NSMath::TBox::DistanceSurface(), NSMath::TAABBox::DistanceSurface(), NSMath::TVector3::DistanceTo(), NSMath::TVector2D::DistanceTo(), NSMath::TQuaternion::Exp(), NSMath::TQuaternion::GetAxis(), TRendererCreatorHelper::GetClosestResolution(), NSMath::TCircle2D::IsIntersectCircle2D(), NSMath::TSphere::IsIntersectPoints(), NSMath::TCircle2D::IsIntersectPoints(), NSMath::TSphere::IsIntersectPointsNormalized(), NSMath::TCircle2D::IsIntersectPointsNormalized(), NSMath::TSphere::IsIntersectsSphere(), NSMath::TVector4::Length(), NSMath::TVector2D::Length(), NSMath::TQuaternion::Length(), NSMath::TMatrix4::LookAtRHStdUp(), NSMath::TSolvers::Matrix3CM_RowEcholonForm_Householder(), NSMath::TVector4::Normalize(), NSMath::TVector3::Normalize(), NSMath::TQuaternion::Normalize(), NSMath::TVector4::NormalizeFast(), NSMath::TVector3::NormalizePrecise(), NSRandom::TRandomNormal::Random(), NSMath::TSolvers::RootsCubicReal(), NSMath::TSolvers::RootsQuadraticReal(), NSMath::TSphere::Set(), NSMath::TCircle2D::Set(), NSMath::TSphere::SetFromPoints(), NSMath::TCircle2D::SetRadiusSquare(), TCameraClassic::TCameraClassic(), and NSMath::TSphere::TSphere(). |
|
Calculate tangent of specified angle in radians.
Definition at line 225 of file StdMath.h. Referenced by NSMath::NSCurves::THermiteCubicSpline::AddPoint(), and NSMath::NSCurves::THermiteCubicSpline::ChangeTangent(). |
|
definition of E
|
|
maximal value for our float values
|
|
definition of PI
Definition at line 32 of file StdMath.h. Referenced by NSMath::TCircle2D::Area(), NSMath::TSolvers::RootsCubicReal(), NSMath::TSphere::Surface(), and NSMath::TSphere::Volume(). |
|
definition of PI*2
Definition at line 33 of file StdMath.h. Referenced by NSMath::TEulerAngles::NormalizeTo_0_PI2(), and NSMath::TCircle2D::Perimeter(). |
|
inverse number to PI*2 ... 1 / PI*2
Definition at line 36 of file StdMath.h. Referenced by NSMath::TEulerAngles::NormalizeTo_0_PI2(). |
|
half of PI
Definition at line 34 of file StdMath.h. Referenced by arccotangent(). |
|
inverse number to PI ... 1 / PI
|