Implements general math utility functions. More...
Go to the source code of this file.
Namespaces | |
chai3d | |
Functions | |
bool | chai3d::cCheckBit (const unsigned int &a_value, const unsigned int &a_bitPosition) |
This function checks if a given bit is enabled. More... | |
unsigned int | chai3d::cSetBit (const unsigned int &a_data, const unsigned int &a_bitPosition, const bool a_value) |
This function sets the value of a specified bit of an unsigned integer. More... | |
bool | chai3d::cZero (const double &a_value) |
This function checks if a value is equal to or almost near zero. More... | |
template<class T > | |
T | chai3d::cAbs (const T &a_value) |
This function computes an absolute value. More... | |
template<class T > | |
double | chai3d::cSign (const T &a_value) |
This function computes the sign of a value. More... | |
template<class T > | |
T | chai3d::cMax (const T &a_value1, const T &a_value2) |
This function computes the maximum value between two values. More... | |
template<class T > | |
T | chai3d::cMin (const T &a_value1, const T &a_value2) |
This function computes the minimum value between two values. More... | |
template<class T > | |
T | chai3d::cMax3 (const T &a_value1, const T &a_value2, const T &a_value3) |
This function computes the maximum value between three values. More... | |
template<class T > | |
T | chai3d::cMin3 (const T &a_value1, const T &a_value2, const T &a_value3) |
This function computes the minimum value between three values. More... | |
template<class T > | |
void | chai3d::cSwap (T &a_value1, T &a_value2) |
This function swaps two elements. More... | |
template<class T > | |
T | chai3d::cLerp (const double &a_level, const T &a_value1, const T &a_value2) |
This function computes a linear interpolation between two values. More... | |
template<class T > | |
T | chai3d::cClamp (const T &a_value, const T &a_low, const T &a_high) |
This function clamps a value to a specified range. More... | |
template<class T > | |
T | chai3d::cClamp0 (const T &a_value) |
This function clamps a value to a value ranged between 0 and infinity. More... | |
double | chai3d::cClamp01 (const double &a_value) |
This function clamps a value to a value ranged between 0.0 and 1.0. More... | |
template<class T , class V > | |
bool | chai3d::cContains (const T &a_value, const V &a_low, const V &a_high) |
This function checks whether a value is within a specified range. More... | |
double | chai3d::cSqr (const double &a_value) |
This function computes the square of a scalar. More... | |
double | chai3d::cSqrt (const double &a_value) |
This function computes the square root of a scalar. More... | |
double | chai3d::cCbrt (const double &a_value) |
This function computes the cubic root of a scalar. More... | |
double | chai3d::cCosDeg (const double &a_angleDeg) |
Compute the cosine of an angle defined in degrees. More... | |
double | chai3d::cSinDeg (const double &a_angleDeg) |
This function computes the sine of an angle defined in degrees. More... | |
double | chai3d::cTanDeg (const double &a_angleDeg) |
This function computes the tangent of an angle defined in degrees. More... | |
double | chai3d::cCosRad (const double &a_angleRad) |
This function computes the cosine of an angle defined in radians. More... | |
double | chai3d::cSinRad (const double &a_angleRad) |
This function computes the sine of an angle defined in radians. More... | |
double | chai3d::cTanRad (const double &a_angleRad) |
This function computes the tangent of an angle defined in radians. More... | |
double | chai3d::cDegToRad (const double &a_angleDeg) |
This function converts an angle from degrees to radians. More... | |
double | chai3d::cRadToDeg (const double &a_angleRad) |
This function converts an angle from radians to degrees. More... | |
int | chai3d::cNumDigits (int a_value) |
This function computes the number of digits that compose a given integer. More... | |
cVector3d | chai3d::cAdd (const cVector3d &a_vector1, const cVector3d &a_vector2) |
This function computes the addition of two vectors. More... | |
cVector3d | chai3d::cAdd (const cVector3d &a_vector1, const cVector3d &a_vector2, const cVector3d &a_vector3) |
This function computes the addition of three vectors. More... | |
cVector3d | chai3d::cSub (const cVector3d &a_vector1, const cVector3d &a_vector2) |
This function computes the subtraction of two vectors. More... | |
cVector3d | chai3d::cNegate (const cVector3d &a_vector) |
This function computes the negated vector. More... | |
cVector3d | chai3d::cMul (const double &a_value, const cVector3d &a_vector) |
This function computes the multiplication of a vector by a scalar. More... | |
cVector3d | chai3d::cDiv (const double &a_value, const cVector3d &a_vector) |
This function computes the division of a vector by a scalar. More... | |
cVector3d | chai3d::cCross (const cVector3d &a_vector1, const cVector3d &a_vector2) |
This function computes the cross product between two vectors. More... | |
double | chai3d::cDot (const cVector3d &a_vector1, const cVector3d &a_vector2) |
This function computes the dot product between two vectors. More... | |
cVector3d | chai3d::cNormalize (const cVector3d &a_vector) |
This function computes the normalized vector. More... | |
double | chai3d::cDistance (const cVector3d &a_point1, const cVector3d &a_point2) |
This function computes the Euclidean distance between two points. More... | |
double | chai3d::cDistanceSq (const cVector3d &a_point1, const cVector3d &a_point2) |
This function computes the squared distance between two points. More... | |
bool | chai3d::cEqualPoints (const cVector3d &a_point1, const cVector3d &a_point2, const double a_epsilon=C_SMALL) |
This function determines whether two vectors are equal (i.e. represent the same point). More... | |
cMatrix3d | chai3d::cIdentity3d (void) |
This function return a 3x3 identity matrix. More... | |
cMatrix3d | chai3d::cAdd (const cMatrix3d &a_matrix1, const cMatrix3d &a_matrix2) |
This function computes the addition between two matrices. More... | |
cMatrix3d | chai3d::cSub (const cMatrix3d &a_matrix1, const cMatrix3d &a_matrix2) |
This function computes the subtraction between two matrices. More... | |
cMatrix3d | chai3d::cRotEulerRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder, const bool a_useIntrinsicEulerModel=true) |
This function builds a rotation matrix from a set of Euler angles defined in radians. More... | |
cMatrix3d | chai3d::cRotEulerDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder, const bool a_useIntrinsicEulerModel=true) |
This function builds a rotation matrix from a set of Euler angles defined in degrees. More... | |
cMatrix3d | chai3d::cRotAxisAngleRad (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleRad) |
This function builds a rotation matrix from an axis-angle representation. More... | |
cMatrix3d | chai3d::cRotAxisAngleDeg (const double &a_axisX, const double &a_axisY, const double &a_axisZ, const double &a_angleDeg) |
This function builds a rotation matrix from an axis-angle representation. More... | |
cMatrix3d | chai3d::cMul (const cMatrix3d &a_matrix1, const cMatrix3d &a_matrix2) |
This function computes the multiplication of two matrices. More... | |
cVector3d | chai3d::cMul (const cMatrix3d &a_matrix, const cVector3d &a_vector) |
This function computes the multiplication of a matrix and a vector. More... | |
cMatrix3d | chai3d::cTranspose (const cMatrix3d &a_matrix) |
This function computes the transpose of a matrix. More... | |
cMatrix3d | chai3d::cInverse (const cMatrix3d &a_matrix) |
This function computes the inverse of a matrix. More... | |
double | chai3d::cAngle (const cVector3d &a_vector1, const cVector3d &a_vector2) |
This function computes the angle in radians between two vectors. More... | |
double | chai3d::cCosAngle (const cVector3d &a_vector1, const cVector3d &a_vector2) |
This function computes the cosine of the angle between two vectors. More... | |