#include "CMatrix3d.h"
#include <math.h>
Functions | |
| bool | cZero (const double &a_value) |
| bool | cPositiveBound (const double &a_value, const double &a_boundMax) |
| template<class T> | |
| T | cAbs (const T a_value) |
| template<class T> | |
| T | cMax (const T a_value1, const T a_value2) |
| template<class T> | |
| T | cMin (const T a_value1, const T a_value2) |
| template<class T> | |
| T | cMax3 (const T &a_value1, const T &a_value2, const T &a_value3) |
| template<class T> | |
| T | cMin3 (const T &a_value1, const T &a_value2, const T &a_value3) |
| template<class T> | |
| T | cMaxAbs (const T a_value1, const T a_value2) |
| template<class T> | |
| T | cMinAbs (const T a_value1, const T a_value2) |
| template<class T> | |
| T | cMax3Abs (const T &a_value1, const T &a_value2, const T &a_value3) |
| template<class T> | |
| T | cMin3Abs (const T &a_value1, const T &a_value2, const T &a_value3) |
| template<class T> | |
| void | cSwap (T &a_value1, T &a_value2) |
| template<class T> | |
| T | cLerp (const double &a_level, const T &a_value1, const T &a_value2) |
| template<class T> | |
| T | cClamp (const T a_value, const T a_low, const T a_high) |
| template<class T> | |
| T | cClamp0 (T &a_value) |
| double | cClamp01 (double &a_value) |
| template<class T, class V> | |
| bool | cContains (const T &a_value, const V &a_low, const V &a_high) |
| double | cSqr (const double &a_value) |
| double | cCosDeg (const double &a_angleDeg) |
| double | cSinDeg (const double &a_angleDeg) |
| double | cTanDeg (const double &a_angleDeg) |
| double | cCosRad (const double &a_angleRad) |
| double | cSinRad (const double &a_value) |
| double | cTanRad (const double &a_value) |
| double | cDegToRad (const double &a_angleDeg) |
| double | cRadToDeg (const double &a_angleRad) |
| cVector3d | cAdd (const cVector3d &a_vector1, const cVector3d &a_vector2) |
| cVector3d | cAdd (const cVector3d &a_vector1, const cVector3d &a_vector2, const cVector3d &a_vector3) |
| cVector3d | cSub (const cVector3d &a_vector1, const cVector3d &a_vector2) |
| cVector3d | cNegate (const cVector3d &a_vector) |
| cVector3d | cMul (const double &a_value, const cVector3d &a_vector) |
| cVector3d | cDiv (const double &a_value, const cVector3d &a_vector) |
| cVector3d | cDivVect (const double &a_value, const cVector3d &a_vector) |
| cVector3d | cCross (const cVector3d &a_vector1, const cVector3d &a_vector2) |
| double | cDot (const cVector3d &a_vector1, const cVector3d &a_vector2) |
| cVector3d | cNormalize (const cVector3d &a_vector) |
| double | cDistance (const cVector3d &a_point1, const cVector3d &a_point2) |
| double | cDistanceSq (const cVector3d &a_point1, const cVector3d &a_point2) |
| bool | cEqualPoints (const cVector3d &v1, const cVector3d &v2, const double epsilon=CHAI_SMALL) |
| cMatrix3d | cIdentity3d (void) |
| cMatrix3d | cMul (const cMatrix3d &a_matrix1, const cMatrix3d &a_matrix2) |
| cVector3d | cMul (const cMatrix3d &a_matrix, const cVector3d &a_vector) |
| cMatrix3d | cTrans (const cMatrix3d &a_matrix) |
| cMatrix3d | cInv (const cMatrix3d &a_matrix) |
| double | cAngle (const cVector3d &a_vector0, const cVector3d &a_vector1) |
| double | cCosAngle (const cVector3d &a_vector0, const cVector3d &a_vector1) |
| cMatrix3d | cRotMatrix (const cVector3d &a_axis, const double &a_angleRad) |
| cMatrix3d | cRotate (const cMatrix3d &a_matrix, const cVector3d &a_axis, const double &a_angleRad) |
| cVector3d | cProjectPointOnPlane (const cVector3d &a_point, const cVector3d &a_planePoint, const cVector3d &n) |
| cVector3d | cProjectPointOnPlane (const cVector3d &a_point, const cVector3d &a_planePoint0, const cVector3d &a_planePoint1, const cVector3d &a_planePoint2) |
| cVector3d | cProjectPointOnLine (const cVector3d &a_point, const cVector3d &a_pointOnLine, const cVector3d &a_directionOfLine) |
| cVector3d | cProject (const cVector3d &a_vector0, const cVector3d &a_vector1) |
| cVector3d | cComputeSurfaceNormal (const cVector3d &a_surfacePoint0, const cVector3d &a_surfacePoint1, const cVector3d &a_surfacePoint2) |
| bool | cBoxContains (const cVector3d &p, const cVector3d &box_min, const cVector3d &box_max) |
| T cAbs | ( | const T | a_value | ) | [inline] |
Compute absolute value.
| a_value | Input value |
| cVector3d cAdd | ( | const cVector3d & | a_vector1, | |
| const cVector3d & | a_vector2, | |||
| const cVector3d & | a_vector3 | |||
| ) | [inline] |
Compute the addition between three vectors. Result = Vector1 + Vector2 + Vector3.
| a_vector1 | First vector. | |
| a_vector2 | Second vector. | |
| a_vector3 | Third vector. |
Compute the addition between two vectors. Result = Vector1 + Vector2.
| a_vector1 | First vector. | |
| a_vector2 | Second vector. |
Compute the angle between two vectors (in radians).
| a_vector0 | Input vector. | |
| a_vector1 | Input vector. |
| bool cBoxContains | ( | const cVector3d & | p, | |
| const cVector3d & | box_min, | |||
| const cVector3d & | box_max | |||
| ) | [inline] |
Returns true if p is contained in the bounding box defined by min and max
| p | Test point | |
| box_min | Minimum coordinate in the boundary box | |
| box_max | Maximum coordinate in the boundary box |
| T cClamp | ( | const T | a_value, | |
| const T | a_low, | |||
| const T | a_high | |||
| ) | [inline] |
Clamp the input to the specified range.
| a_value | Input value. | |
| a_low | Low boundary. | |
| a_high | High boundary. |
| T cClamp0 | ( | T & | a_value | ) | [inline] |
Clamp the input to the range 0 - infinity.
| a_value | Input value. |
| double cClamp01 | ( | double & | a_value | ) | [inline] |
Clamp the input to the range [0,1].
| a_value | Input value of type double. |
| cVector3d cComputeSurfaceNormal | ( | const cVector3d & | a_surfacePoint0, | |
| const cVector3d & | a_surfacePoint1, | |||
| const cVector3d & | a_surfacePoint2 | |||
| ) | [inline] |
Compute the normal of a surface defined by three point passed as parameters.
| a_surfacePoint0 | Point 0 of surface. | |
| a_surfacePoint1 | Point 1 of surface. | |
| a_surfacePoint2 | Point 2 of surface. |
| bool cContains | ( | const T & | a_value, | |
| const V & | a_low, | |||
| const V & | a_high | |||
| ) | [inline] |
Check whether input is in the range of [low, high].
| a_value | Input value. | |
| a_low | Low boundary. | |
| a_high | High boundary. |
Compute cosine of the angle between two vectors.
| a_vector0 | Input vector. | |
| a_vector1 | Input vector. |
| double cCosDeg | ( | const double & | a_angleDeg | ) | [inline] |
Compute the cosine of an angle defined in degrees.
| a_angleDeg | Angle in degrees. |
| double cCosRad | ( | const double & | a_angleRad | ) | [inline] |
Return the cosine of an angle defined in radians.
| a_angleRad | Angle in radians. |
Compute the cross product between two 3D vectors.
| a_vector1 | First vector. | |
| a_vector2 | Second vector. |
| double cDegToRad | ( | const double & | a_angleDeg | ) | [inline] |
Convert an angle from degrees to radians.
| a_angleDeg | Angle in degrees. |
Compute the distance between two points.
| a_point1 | First point. | |
| a_point2 | Second point. |
Compute the squared distance between two points.
| a_point1 | First point. | |
| a_point2 | Second point. |
Divide a vector by a scalar.
| a_value | Scalar. | |
| a_vector | Input vector. |
Divide a scalar by components of a 3D vector and return vector
| a_value | Scalar. | |
| a_vector | Input vector. |
Compute the dot product between two vectors.
| a_vector1 | First vector. | |
| a_vector2 | Second vector. |
| bool inline cEqualPoints | ( | const cVector3d & | v1, | |
| const cVector3d & | v2, | |||
| const double | epsilon = CHAI_SMALL | |||
| ) | [inline] |
Determine whether two vectors represent the same point.
| v1 | First point. | |
| v2 | Second point. | |
| epsilon | Two points will be considered equal if each component is within epsilon units. Defaults to CHAI_SMALL. |
| cMatrix3d cIdentity3d | ( | void | ) | [inline] |
Return the Identity Matrix
Compute the inverse of a matrix.
| a_matrix | Input matrix. |
| T cLerp | ( | const double & | a_level, | |
| const T & | a_value1, | |||
| const T & | a_value2 | |||
| ) | [inline] |
Linear interpolation from value0 (when a=0) to value1 (when a=1).
| a_level | Interpolation parameter. | |
| a_value1 | First value. | |
| a_value2 | Second value. |
| T cMax | ( | const T | a_value1, | |
| const T | a_value2 | |||
| ) | [inline] |
Compute maximum between two values
| a_value1 | First value. | |
| a_value2 | Second value. |
| T cMax3 | ( | const T & | a_value1, | |
| const T & | a_value2, | |||
| const T & | a_value3 | |||
| ) | [inline] |
Compute maximum of 3 values.
| a_value1 | First value. | |
| a_value2 | Second value. | |
| a_value3 | Third value. |
| T cMax3Abs | ( | const T & | a_value1, | |
| const T & | a_value2, | |||
| const T & | a_value3 | |||
| ) | [inline] |
Compute maximum of absolute values of 3 values.
| a_value1 | First value. | |
| a_value2 | Second value. | |
| a_value3 | Third value. |
| T cMaxAbs | ( | const T | a_value1, | |
| const T | a_value2 | |||
| ) | [inline] |
Compute maximum of absolute values of 2 numbers.
| a_value1 | First value. | |
| a_value2 | Second value. |
| T cMin | ( | const T | a_value1, | |
| const T | a_value2 | |||
| ) | [inline] |
Compute minimum between two values
| a_value1 | First value. | |
| a_value2 | Second value. |
| T cMin3 | ( | const T & | a_value1, | |
| const T & | a_value2, | |||
| const T & | a_value3 | |||
| ) | [inline] |
Return minimum of 3 values.
| a_value1 | First value. | |
| a_value2 | Second value. | |
| a_value3 | Third value. |
| T cMin3Abs | ( | const T & | a_value1, | |
| const T & | a_value2, | |||
| const T & | a_value3 | |||
| ) | [inline] |
Compute minimum of absolute values of 3 values.
| a_value1 | First value. | |
| a_value2 | Second value. | |
| a_value3 | Third value. |
| T cMinAbs | ( | const T | a_value1, | |
| const T | a_value2 | |||
| ) | [inline] |
Compute minimum of absolute values of 2 values.
| a_value1 | First value. | |
| a_value2 | Second value. |
Compute the multiplication of a matrix and a vector.
| a_matrix | Input matrix. | |
| a_vector | Input vector. |
Compute the multiplication between two matrices.
| a_matrix1 | First matrix. | |
| a_matrix2 | Second matrix. |
Multiply a vector by a scalar.
| a_value | Scalar. | |
| a_vector | Input vector. |
Compute the negated vector of a input vector.
| a_vector | Input vector. |
Compute the normalized vector (length = 1) of an input vector.
| a_vector | Input vector. |
| bool cPositiveBound | ( | const double & | a_value, | |
| const double & | a_boundMax | |||
| ) | [inline] |
Check if value is strictly positive and less than maxBound in case maxBound is positive.
| a_value | Value to be checked. | |
| a_boundMax | Positive bound. |
Project a vector V0 onto a second vector V1.
| a_vector0 | Vector 0. | |
| a_vector1 | Vector 1. |
| cVector3d cProjectPointOnLine | ( | const cVector3d & | a_point, | |
| const cVector3d & | a_pointOnLine, | |||
| const cVector3d & | a_directionOfLine | |||
| ) | [inline] |
Compute the projection of a point on a line. the line is expressed by a point located on the line and a direction vector.
| a_point | Point to project on the line. | |
| a_pointOnLine | Point located on the line | |
| a_directionOfLine | Vector expressing the direction of the line |
| cVector3d cProjectPointOnPlane | ( | const cVector3d & | a_point, | |
| const cVector3d & | a_planePoint0, | |||
| const cVector3d & | a_planePoint1, | |||
| const cVector3d & | a_planePoint2 | |||
| ) | [inline] |
Compute the projection of a point on a plane. the plane is expressed by a set of three points.
| a_point | Point to project on plane. | |
| a_planePoint0 | Point 0 on plane. | |
| a_planePoint1 | Point 1 on plane. | |
| a_planePoint2 | Point 2 on plane. |
| cVector3d cProjectPointOnPlane | ( | const cVector3d & | a_point, | |
| const cVector3d & | a_planePoint, | |||
| const cVector3d & | n | |||
| ) | [inline] |
Compute the projection of a point on a plane. the plane is expressed by a point and a surface normal.
| a_point | Point to project on plane. | |
| a_planePoint | Point on plane. | |
| n | Plane normal. |
| double cRadToDeg | ( | const double & | a_angleRad | ) | [inline] |
Convert an angle from radians to degrees
| a_angleRad | Angle in radians. |
| cMatrix3d cRotate | ( | const cMatrix3d & | a_matrix, | |
| const cVector3d & | a_axis, | |||
| const double & | a_angleRad | |||
| ) | [inline] |
Compute the rotation of a matrix around an axis and an angle.
| a_matrix | Input matrix. | |
| a_axis | Axis of rotation. | |
| a_angleRad | Rotation angle in Radian. |
Compute a rotation matrix given a rotation axis and an angle.
| a_axis | Axis of rotation. | |
| a_angleRad | Rotation angle in Radian. |
| double cSinDeg | ( | const double & | a_angleDeg | ) | [inline] |
Compute the sine of an angle defined in degrees.
| a_angleDeg | Angle in degrees. |
| double cSinRad | ( | const double & | a_value | ) | [inline] |
Return the sine of an angle defined in radians.
| a_value | Angle in radians. |
| double cSqr | ( | const double & | a_value | ) | [inline] |
Compute the square of a double.
| a_value | Input value. |
Compute the subtraction between two vectors. Result = Vector1 - Vector2.
| a_vector1 | First vector. | |
| a_vector2 | Second vector. |
| void cSwap | ( | T & | a_value1, | |
| T & | a_value2 | |||
| ) | [inline] |
Swap two elements.
| a_value1 | First value. | |
| a_value2 | Second value. |
| double cTanDeg | ( | const double & | a_angleDeg | ) | [inline] |
Compute the tangent of an angle defined in degrees.
| a_angleDeg | Angle in degrees. |
| double cTanRad | ( | const double & | a_value | ) | [inline] |
Return the tangent of an angle defined in radians.
| a_value | Angle in radians. |
Compute the transpose of a matrix
| a_matrix | Input matrix. |
| bool cZero | ( | const double & | a_value | ) | [inline] |
Check if value is equal or near zero.
| a_value | Value to be checked. |
1.5.2