Math

Implements general math tools. More...

Files

file  CBezier.h
 Implements support for Bezier curves and surface patches.
 
file  CConstants.h
 Implements mathematical constants.
 
file  CGeometry.h
 Implements general geometry utility functions.
 
file  CMarchingCubes.h
 Implementation of the marching cube algorithm.
 
file  CMaths.h
 Implements general math utility functions.
 
file  CMatrix3d.h
 Implements a 3D matrix.
 
file  CPolySolver.h
 Implements polynomial solvers.
 
file  CQuaternion.h
 Implements a quaternion.
 
file  CTransform.h
 Implements a transformation matrix.
 
file  CVector3d.h
 Implements a 3D vector.
 

Classes

struct  chai3d::cMarchingCubeTriangle
 
struct  chai3d::cMarchingCubeGridCell
 
struct  chai3d::cMatrix3d
 This class implements a 3D matrix. More...
 
struct  chai3d::cQuaternion
 This class implements a quaternion. More...
 
struct  chai3d::cTransform
 This class implements a 4D transformation matrix encoded as column-major. More...
 
struct  chai3d::cVector3d
 This class implements a 3D vector. More...
 

Functions

cVector3d chai3d::cEvalBezierCurve (const cVector3d *a_controlPoints, double a_t)
 This function determines the position of a point along a Bezier curve. More...
 
cVector3d chai3d::cEvalBezierPatch (const cVector3d *a_controlPoints, double a_u, double a_v)
 This function determines the position of a point along a Bezier patch. More...
 
cVector3d chai3d::cDerivBezier (const cVector3d *a_controlPoints, double a_t)
 This function determines the derivative of a point along a Bezier curve. More...
 
cVector3d chai3d::cDerivUBezier (const cVector3d *a_controlPoints, double a_u, double a_v)
 This function determines the derivative of a point on a Bezier patch along the u parametric direction. More...
 
cVector3d chai3d::cDerivVBezier (const cVector3d *a_controlPoints, double a_u, double a_v)
 This function determines the derivative of a point on a Bezier patch along the v parametric direction. More...
 
cVector3d chai3d::cSurfaceNormalBezier (const cVector3d *a_controlPoints, double a_u, double a_v)
 This function determines the surface normal at a point on a Bezier patch. More...
 
double chai3d::cTriangleArea (const cVector3d &a_vertex0, const cVector3d &a_vertex1, const cVector3d &a_vertex2)
 This function computes the area of a triangle. More...
 
cVector3d chai3d::cProjectPointOnPlane (const cVector3d &a_point, const cVector3d &a_planePoint, const cVector3d &a_planeNormal)
 This function computes the projection of a point onto a plane. More...
 
cVector3d chai3d::cProjectPointOnPlane (const cVector3d &a_point, const cVector3d &a_planePoint0, const cVector3d &a_planePoint1, const cVector3d &a_planePoint2)
 This function computes the projection of a point onto a plane. More...
 
void chai3d::cProjectPointOnPlane (const cVector3d &a_point, const cVector3d &a_planePoint0, const cVector3d &a_planePoint1, const cVector3d &a_planePoint2, double &a_r01, double &a_r02)
 This function computes the projection of a point onto a plane. More...
 
cVector3d chai3d::cProjectPointOnLine (const cVector3d &a_point, const cVector3d &a_pointOnLine, const cVector3d &a_directionOfLine)
 This function computes the projection of a point onto a line. More...
 
cVector3d chai3d::cProjectPointOnSegment (const cVector3d &a_point, const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB)
 This function computes the projection of a point onto a segment. More...
 
cVector3d chai3d::cProjectPointOnDiskXY (const cVector3d &a_point, const double &a_height, const double &a_radius)
 This function computes the projection of a point onto a disk. More...
 
cVector3d chai3d::cProjectPointOnTriangle (const cVector3d &a_point, const cVector3d &a_vertex0, const cVector3d &a_vertex1, const cVector3d &a_vertex2)
 This function computes the projection of a point onto a triangle. More...
 
cVector3d chai3d::cProject (const cVector3d &a_vector0, const cVector3d &a_vector1)
 This function computes the projection of a vector V0 onto a vector V1. More...
 
double chai3d::cDistanceToLine (const cVector3d &a_point, const cVector3d &a_linePoint1, const cVector3d &a_linePoint2)
 This function computes the distance between a point and a line. More...
 
cVector3d chai3d::cComputeSurfaceNormal (const cVector3d &a_surfacePoint0, const cVector3d &a_surfacePoint1, const cVector3d &a_surfacePoint2)
 This function computes the surface normal of a plane. More...
 
bool chai3d::cBoxContains (const cVector3d &a_point, const cVector3d &a_boxMin, const cVector3d &a_boxMax)
 This function checks if a point is contained in a box. More...
 
int chai3d::cIntersectionSegmentPlane (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_planePos, const cVector3d &a_planeNormal, cVector3d &a_collisionPoint, cVector3d &a_collisionNormal)
 This function computes the intersection between a segment and a plane. More...
 
int chai3d::cIntersectionSegmentDisk (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_diskPos, const cVector3d &a_diskNormal, const double &a_diskRadius, cVector3d &a_collisionPoint, cVector3d &a_collisionNormal)
 This function computes the intersection between a segment and a disk. More...
 
int chai3d::cIntersectionSegmentSphere (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_spherePos, const double &a_sphereRadius, cVector3d &a_collisionPoint0, cVector3d &a_collisionNormal0, cVector3d &a_collisionPoint1, cVector3d &a_collisionNormal1)
 This function computes the intersection between a segment and a sphere. More...
 
int chai3d::cIntersectionSegmentEllipsoid (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_pos, const double &a_radiusX, const double &a_radiusY, const double &a_radiusZ, cVector3d &a_collisionPoint0, cVector3d &a_collisionNormal0, cVector3d &a_collisionPoint1, cVector3d &a_collisionNormal1)
 This function computes the intersection between a segment and a sphere. More...
 
int chai3d::cIntersectionSegmentToplessCylinder (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_cylinderPointA, const cVector3d &a_cylinderPointB, const double &a_cylinderRadius, cVector3d &a_collisionPoint0, cVector3d &a_collisionNormal0, double &a_collisionPointRelPosAB0, cVector3d &a_collisionPoint1, cVector3d &a_collisionNormal1, double &a_collisionPointRelPosAB1)
 This function computes the intersection between a segment and a topless cylinder. More...
 
int chai3d::cIntersectionSegmentCylinder (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const double &a_baseRadius, const double &a_topRadius, const double &a_height, cVector3d &a_collisionPoint, cVector3d &a_collisionNormal)
 This function computes the nearest intersection point between a segment and a cylinder. More...
 
int chai3d::cIntersectionSegmentBox (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_boxMin, const cVector3d &a_boxMax, cVector3d &a_collisionPoint, cVector3d &a_collisionNormal)
 This function computes the nearest intersection point between a segment and a box. More...
 
int chai3d::cIntersectionSegmentTorus (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const double &a_innerRadius, const double &a_outerRadius, cVector3d &a_collisionPoint, cVector3d &a_collisionNormal)
 This function computes the nearest intersection point between a segment and a torus. More...
 
bool chai3d::cIntersectionSegmentTriangle (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, const cVector3d &a_triangleVertex0, const cVector3d &a_triangleVertex1, const cVector3d &a_triangleVertex2, const bool a_reportFrontSideCollision, const bool a_reportBackSideCollision, cVector3d &a_collisionPoint, cVector3d &a_collisionNormal, double &a_collisionPosVertex01, double &a_collisionPosVertex02)
 This function computes the intersection between a segment and a triangle. More...
 
cVector3d chai3d::cVertexInterpolation (double a_isolevel, cVector3d a_p1, cVector3d a_p2, double a_valp1, double a_valp2)
 This function linearly interpolate the position where an isosurface cuts an edge between two vertices, each with their own scalar value. More...
 
int chai3d::cPolygonize (cMarchingCubeGridCell a_grid, double a_isolevel, cMarchingCubeTriangle *a_triangles)
 This function calculates the triangular facets required to represent the isosurface through the cell. More...
 
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 >
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 >
chai3d::cMax (const T &a_value1, const T &a_value2)
 This function computes the maximum value between two values. More...
 
template<class T >
chai3d::cMin (const T &a_value1, const T &a_value2)
 This function computes the minimum value between two values. More...
 
template<class 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 >
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 >
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 >
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 >
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...
 
int chai3d::cSolveLinear (double a_coefficient[2], double a_solution[1])
 This function computes the solution of a linear equation. More...
 
int chai3d::cSolveQuadric (double a_coefficient[3], double a_solution[2])
 This function computes the solution of a quadric equation. More...
 
int chai3d::cSolveCubic (double a_coefficient[4], double a_solution[3])
 This function computes the solution of a cubic equation. More...
 
int chai3d::cSolveQuartic (double a_coefficient[5], double a_solution[4])
 This function computes the solution of a quartic equation. More...
 

Detailed Description

Function Documentation

cVector3d chai3d::cEvalBezierCurve ( const cVector3d a_controlPoints,
double  a_t 
)
inline

This function determines the position of a point along a Bezier curve at t [0:1].

Parameters
a_controlPointsControl points. (4 in total)
a_tParameter t between 0 and 1.
Returns
The computed point.
cVector3d chai3d::cEvalBezierPatch ( const cVector3d a_controlPoints,
double  a_u,
double  a_v 
)
inline

This function determines the position of a point along a Bezier patch at u [0:1] and v [0:1].

Parameters
a_controlPointsControl points. (16 in total)
a_uParameter u between 0 and 1.
a_vParameter v between 0 and 1.
Returns
The computed point.
cVector3d chai3d::cDerivBezier ( const cVector3d a_controlPoints,
double  a_t 
)
inline

This function determines the derivative of a point along a Bezier curve at t [0:1].

Parameters
a_controlPointsControl points. (4 in total)
a_tParameter t between 0 and 1.
Returns
The computed derivative.
cVector3d chai3d::cDerivUBezier ( const cVector3d a_controlPoints,
double  a_u,
double  a_v 
)
inline

This function determines the derivative of a point on a Bezier patch along the u parametric direction.

Parameters
a_controlPointsControl points. (16 in total)
a_uParameter u between 0 and 1.
a_vParameter v between 0 and 1.
Returns
The computed derivative.
cVector3d chai3d::cDerivVBezier ( const cVector3d a_controlPoints,
double  a_u,
double  a_v 
)
inline

This function determines the derivative of a point on a Bezier patch along the v parametric direction.

Parameters
a_controlPointsControl points. (16 in total)
a_uParameter u between 0 and 1.
a_vParameter v between 0 and 1.
Returns
The computed derivative.
cVector3d chai3d::cSurfaceNormalBezier ( const cVector3d a_controlPoints,
double  a_u,
double  a_v 
)
inline

This function determines the surface normal at a point on a Bezier patch at u [0:1] and v [0:1].

Parameters
a_controlPointsControl points. (16 in total)
a_uParameter u between 0 and 1.
a_vParameter v between 0 and 1.
Returns
The computed surface normal.
double chai3d::cTriangleArea ( const cVector3d a_vertex0,
const cVector3d a_vertex1,
const cVector3d a_vertex2 
)
inline

This function computes the area of a triangle described by the position of its three vertices a_vertex0, a_vertex1, and a_vertex2.

Parameters
a_vertex0Vertex 0 of triangle.
a_vertex1Vertex 1 of triangle.
a_vertex2Vertex 2 of triangle.
Returns
The area of the triangle.
cVector3d chai3d::cProjectPointOnPlane ( const cVector3d a_point,
const cVector3d a_planePoint,
const cVector3d a_planeNormal 
)
inline

This function computes the projection of a point a_point onto a plane. The plane is expressed by a point a_planePoint and a surface normal a_planeNormal.

Parameters
a_pointPoint to be projected on the plane.
a_planePointPoint on the plane.
a_planeNormalSurface normal of the plane.
Returns
The projection of the point onto the plane.
cVector3d chai3d::cProjectPointOnPlane ( const cVector3d a_point,
const cVector3d a_planePoint0,
const cVector3d a_planePoint1,
const cVector3d a_planePoint2 
)
inline

This function computes the projection of a point onto a plane. The plane is expressed by a set of three points passed by argument.

Parameters
a_pointPoint to be projected onto the plane.
a_planePoint0Point 0 of plane.
a_planePoint1Point 1 of plane.
a_planePoint2Point 2 of plane.
Returns
The projection of the point onto the plane.
void chai3d::cProjectPointOnPlane ( const cVector3d a_point,
const cVector3d a_planePoint0,
const cVector3d a_planePoint1,
const cVector3d a_planePoint2,
double &  a_r01,
double &  a_r02 
)
inline

This function computes the projection of a point a_point onto a plane described by three points a_planePoint0, a_planePoint1, and a_planePoint2.

The function returns two parameters a_r01 and a_r01 which describe the position of the projected point onto the plane.

projectedPoint = a_planePoint0 + a_r01 * V01 + a_r02 * V02

where:

V01 = a_planePoint1 - a_planePoint0
V02 = a_planePoint2 - a_planePoint0
Parameters
a_pointPoint to be projected onto plane.
a_planePoint0Point 0 of plane.
a_planePoint1Point 1 of plane.
a_planePoint2Point 2 of plane.
a_r01Returned relative position factor v01.
a_r02Returned relative position factor v02.
cVector3d chai3d::cProjectPointOnLine ( const cVector3d a_point,
const cVector3d a_pointOnLine,
const cVector3d a_directionOfLine 
)
inline

This function computes the projection of a point a_point on a line. The line is expressed by a point a_pointOnLine located on the line and a direction vector a_directionOfLine.

Parameters
a_pointPoint to be projected onto the line.
a_pointOnLinePoint located on the line.
a_directionOfLineDirection vector of the line.
Returns
The projection of the point onto the line.
cVector3d chai3d::cProjectPointOnSegment ( const cVector3d a_point,
const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB 
)
inline

This function computes the projection of a point a_point onto a segment. The segment is described by its two extremity points a_segmentPointA and a_segmentPointB.

Parameters
a_pointPoint to be projected.
a_segmentPointAPoint A of segment.
a_segmentPointBPoint B of segment.
Returns
The projection of the point onto the segment.
cVector3d chai3d::cProjectPointOnDiskXY ( const cVector3d a_point,
const double &  a_height,
const double &  a_radius 
)
inline

This function computes the projection of a point onto a disk lying in the XY plane.
The position of the disk along the z-axis is expressed by parameter a_height.
The radius of the disk is expressed by parameter a_radius.

Parameters
a_pointPoint to be projected.
a_heightPosition of the disk along the z-axis.
a_radiusRadius of the disk.
Returns
The projection of the point onto the disk.
cVector3d chai3d::cProjectPointOnTriangle ( const cVector3d a_point,
const cVector3d a_vertex0,
const cVector3d a_vertex1,
const cVector3d a_vertex2 
)
inline

This function computes the projection of a point onto a triangle expressed by its three vertices.

Parameters
a_pointPoint to be projected.
a_vertex0Triangle vertex 0.
a_vertex1Triangle vertex 1.
a_vertex2Triangle vertex 2.
Returns
The projection of the point onto the triangle.
cVector3d chai3d::cProject ( const cVector3d a_vector0,
const cVector3d a_vector1 
)
inline

This function computes the projection of a vector V0 onto a vector V1, where V0 and V1 are passed by argument as a_vector0 and a_vector1.

Parameters
a_vector0Vector V0.
a_vector1Vector V1.
Returns
The projection of vector V0 onto vector V1.
double chai3d::cDistanceToLine ( const cVector3d a_point,
const cVector3d a_linePoint1,
const cVector3d a_linePoint2 
)
inline

This function computes the distance between a point and a line. The line is described by two points a_linePoint1 and a_linePoint2 located along the line.

Parameters
a_pointPoint to be tested.
a_linePoint1Point 1 on line.
a_linePoint2Point 2 on line.
Returns
The distance between the point and the line.
cVector3d chai3d::cComputeSurfaceNormal ( const cVector3d a_surfacePoint0,
const cVector3d a_surfacePoint1,
const cVector3d a_surfacePoint2 
)
inline

This function computes the surface normal of a plane defined by three points passed by argument.

Parameters
a_surfacePoint0Point 0 on surface.
a_surfacePoint1Point 1 on surface.
a_surfacePoint2Point 2 on surface.
Returns
The surface normal.
bool chai3d::cBoxContains ( const cVector3d a_point,
const cVector3d a_boxMin,
const cVector3d a_boxMax 
)
inline

This function check if a point is contained in a box. The box is described by its minimum and maximum corners a_boxMin and a_boxMax.
If the point is located inside the box, then then function returns true, otherwise it returns false.

Parameters
a_pointTest point.
a_boxMinMinimum coordinate of the box.
a_boxMaxMaximum coordinate of the box.
Returns
true if the point is contained in the box, false otherwise.
int chai3d::cIntersectionSegmentPlane ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_planePos,
const cVector3d a_planeNormal,
cVector3d a_collisionPoint,
cVector3d a_collisionNormal 
)
inline

This function computes the intersection between a segment and a plane.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The plane is described by a point a_planePos and a surface normal a_planeNormal.
The function returns the number of collision points that were detected (0 or 1).
If a collision occurs, the collision point and collision normal are returned by arguments a_collisionPoint and a_collisionNormal.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_planePosPosition of a point on the plane.
a_planeNormalSurface normal of the plane.
a_collisionPointReturned intersection point (if detected).
a_collisionNormalReturned surface normal at intersection point (if detected).
Returns
The number of intersection points found (0 or 1).
int chai3d::cIntersectionSegmentDisk ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_diskPos,
const cVector3d a_diskNormal,
const double &  a_diskRadius,
cVector3d a_collisionPoint,
cVector3d a_collisionNormal 
)
inline

This function computes the intersection between a segment and a disk.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The disk is described by a point a_diskPos, a surface normal a_diskNormal, and a radius a_diskRadius.
The function returns the number of collision points that were detected (0 or 1).
If a collision occurs, the collision point and collision normal are returned by arguments a_collisionPoint and a_collisionNormal.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_diskPosPosition of the disk center.
a_diskNormalSurface normal of the disk.
a_diskRadiusRadius of the disk.
a_collisionPointReturned intersection point (if detected).
a_collisionNormalReturned surface normal at intersection point (if detected).
Returns
The number of intersection points found (0 or 1).
int chai3d::cIntersectionSegmentSphere ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_spherePos,
const double &  a_sphereRadius,
cVector3d a_collisionPoint0,
cVector3d a_collisionNormal0,
cVector3d a_collisionPoint1,
cVector3d a_collisionNormal1 
)
inline

This function computes the intersection between a segment and a sphere.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The sphere is described by its position a_spherePos and a radius a_sphereRadius.
The function returns the number of collision points that were detected (0, 1, or 2).
If a collision occurs, the collision point(s) and collision normal(s) are returned by arguments a_collisionPoint0, a_collisionNormal0, a_collisionPoint1, and a_collisionNormal1.
If two intersection points are detected, collisionPoint0 is the nearest point to segmentPointA of segment AB.
If the segment begins inside the sphere, then all intersections are ignored.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_spherePosPosition of sphere center.
a_sphereRadiusRadius of sphere.
a_collisionPoint0Returned intersection point 0 (if detected).
a_collisionNormal0Returned surface normal 0 at intersection point (if detected).
a_collisionPoint1Returned intersection point 1 (if detected).
a_collisionNormal1Returned surface normal 1 at intersection point (if detected).
Returns
The number of intersection points found (0, 1, or 2).
int chai3d::cIntersectionSegmentEllipsoid ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_pos,
const double &  a_radiusX,
const double &  a_radiusY,
const double &  a_radiusZ,
cVector3d a_collisionPoint0,
cVector3d a_collisionNormal0,
cVector3d a_collisionPoint1,
cVector3d a_collisionNormal1 
)
inline

This function computes the intersection between a segment and a sphere.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The sphere is described by its position a_spherePos and a radius a_sphereRadius.
The function returns the number of collision points that were detected (0, 1, or 2).
If a collision occurs, the collision point(s) and collision normal(s) are returned by arguments a_collisionPoint0, a_collisionNormal0, a_collisionPoint1, and a_collisionNormal1.
If two intersection points are detected, collisionPoint0 is the nearest point to segmentPointA of segment AB.
If the segment begins inside the sphere, then all intersections are ignored.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_posPosition of ellipsoid center.
a_radiusXEllipsoid radius along x axis.
a_radiusYEllipsoid radius along y axis.
a_radiusZEllipsoid radius along z axis.
a_collisionPoint0Returned intersection point 0 (if detected).
a_collisionNormal0Returned surface normal 0 at intersection point (if detected).
a_collisionPoint1Returned intersection point 1 (if detected).
a_collisionNormal1Returned surface normal 1 at intersection point (if detected).
Returns
The number of intersection points found (0, 1, or 2).
int chai3d::cIntersectionSegmentToplessCylinder ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_cylinderPointA,
const cVector3d a_cylinderPointB,
const double &  a_cylinderRadius,
cVector3d a_collisionPoint0,
cVector3d a_collisionNormal0,
double &  a_collisionPointRelPosAB0,
cVector3d a_collisionPoint1,
cVector3d a_collisionNormal1,
double &  a_collisionPointRelPosAB1 
)
inline

This function computes the intersection between a segment and a topless cylinder.

The segment is described by two points a_segmentPointA and a_segmentPointB.
The cylinder is described by two extremity points a_cylinderPointA and a_cylinderPointB, and a radius a_cylinderRadius.
The function returns the number of collision points that were detected (0, 1, or 2).
If a collision occurs, the collision point(s) and collision normal(s) are returned by arguments a_collisionPoint0, a_collisionPoint1, a_collisionNormal0 and a_collisionNormal1.
If two intersection points occur, collisionPoint0 is the nearest point to segmentPointA of segment AB.
If the segment begins inside the cylinder, then all intersections are ignored.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_cylinderPointAExtremity point A of cylinder.
a_cylinderPointBExtremity point B of cylinder.
a_cylinderRadiusRadius of cylinder.
a_collisionPoint0Returned intersection point 0 (if detected).
a_collisionNormal0Returned surface normal 0 at intersection point (if detected).
a_collisionPointRelPosAB0Returned relative position of collision point 0 projected on segment a_segmentPointA - a_segmentPointB
a_collisionPoint1Returned intersection point 1 (if detected).
a_collisionNormal1Returned surface normal 1 at intersection point (if detected).
a_collisionPointRelPosAB1Returned relative position of collision point 1 projected on segment a_segmentPointA - a_segmentPointB
Returns
The number of intersection points found (0, 1, or 2).
int chai3d::cIntersectionSegmentCylinder ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const double &  a_baseRadius,
const double &  a_topRadius,
const double &  a_height,
cVector3d a_collisionPoint,
cVector3d a_collisionNormal 
)
inline

This function computes the nearest intersection point between a segment and a cylinder.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The cylinder is aligned along the z-axis and is described by its height a_height, base radius a_baseRadius, and a top radius a_topRadius.
The function returns the number of collision points that were detected (0 or 1).
If a collision occurs, the collision point and collision normal are returned by arguments a_collisionPoint and a_collisionNormal.
If the segment begins inside the cylinder, then all intersections are ignored.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_baseRadiusRadius of cylinder a z = 0.0.
a_topRadiusRadius of cylinder a z = a_height.
a_heightHeight of cylinder.
a_collisionPointReturned intersection point (if detected).
a_collisionNormalReturned surface normal at intersection point (if detected).
Returns
The number of intersection points found (0 or 1).
int chai3d::cIntersectionSegmentBox ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_boxMin,
const cVector3d a_boxMax,
cVector3d a_collisionPoint,
cVector3d a_collisionNormal 
)
inline

This function computes the nearest intersection point between a segment and a box.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The box is aligned with all axes and is described by its minimum and maximum corners a_boxMin and a_boxMax.

The function returns the number of collision points that were detected (0 or 1).
If a collision occurs, the collision point and collision normal are returned by arguments a_collisionPoint and a_collisionNormal.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_boxMinMinimum coordinate of box.
a_boxMaxMaximum coordinate of box.
a_collisionPointReturned intersection point (if detected).
a_collisionNormalReturned surface normal at intersection point (if detected).
Returns
The number of intersection points found (0 or 1).
int chai3d::cIntersectionSegmentTorus ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const double &  a_innerRadius,
const double &  a_outerRadius,
cVector3d a_collisionPoint,
cVector3d a_collisionNormal 
)
inline

This function computes the nearest intersection point between a segment and a torus centered around the z-axis.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The torus is described by its inner a_innerRadius and outer radius a_outerRadius.
The function returns the number of collision points that were detected (0 or 1).
If a collision occurs, the collision point and collision normal are returned by arguments a_collisionPoint and a_collisionNormal.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_innerRadiusInner radius of torus.
a_outerRadiusOuter radius of torus.
a_collisionPointReturned intersection point (if detected).
a_collisionNormalReturned surface normal at intersection point (if detected).
Returns
The number of intersection points found (0 or 1).
bool chai3d::cIntersectionSegmentTriangle ( const cVector3d a_segmentPointA,
const cVector3d a_segmentPointB,
const cVector3d a_triangleVertex0,
const cVector3d a_triangleVertex1,
const cVector3d a_triangleVertex2,
const bool  a_reportFrontSideCollision,
const bool  a_reportBackSideCollision,
cVector3d a_collisionPoint,
cVector3d a_collisionNormal,
double &  a_collisionPosVertex01,
double &  a_collisionPosVertex02 
)
inline

This function computes the intersection between a segment and a triangle defined by three vertices a_triangleVertex0, a_triangleVertex1, and a_triangleVertex2.
The segment is described by two points a_segmentPointA and a_segmentPointB.
The function returns the number of collision points that were detected (0 or 1).
If a collision occurs, the collision point and collision normal are returned by arguments a_collisionPoint and a_collisionNormal.

Parameters
a_segmentPointAFirst point of segment AB.
a_segmentPointBSecond point of segment AB.
a_triangleVertex0Vertex 0 of triangle.
a_triangleVertex1Vertex 1 of triangle.
a_triangleVertex2Vertex 2 of triangle.
a_reportFrontSideCollisionIf true, then front side collisions are reported.
a_reportBackSideCollisionIf true, then back side collisions are reported.
a_collisionPointReturned intersection point (if detected).
a_collisionNormalReturned surface normal at intersection point (if detected).
a_collisionPosVertex01Returned relative position of collision point projected on segment a_triangleVertex0 -a_triangleVertex1.
a_collisionPosVertex02Returned relative position of collision point projected on segment a_triangleVertex0 -a_triangleVertex1
Returns
true if a collision has occurred, otherwise false.
cVector3d chai3d::cVertexInterpolation ( double  a_isolevel,
cVector3d  a_p1,
cVector3d  a_p2,
double  a_valp1,
double  a_valp2 
)
inline

This function linearly interpolate the position where an isosurface cuts an edge between two vertices, each with their own scalar value.

Parameters
a_isolevelIso value.
a_p1Point 1.
a_p2Point 2.
a_valp1Value at point 1.
a_valp2Value at point 2.
Returns
The interpolated point.
int chai3d::cPolygonize ( cMarchingCubeGridCell  a_grid,
double  a_isolevel,
cMarchingCubeTriangle a_triangles 
)
inline

Given a grid cell and an isolevel, this function calculates the triangular facets required to represent the isosurface through the cell. The function returns the number of triangular facets and at most 5 of them. 0 will be returned if the grid cell is either totally above of totally below the isolevel.

Parameters
a_gridGrid composed of 8 voxels
a_isolevelIsovalue.
a_trianglesReturned triangles.
Returns
The number of triangles.
bool chai3d::cCheckBit ( const unsigned int &  a_value,
const unsigned int &  a_bitPosition 
)
inline

This function checks if a given bit is enabled. The function takes by argument an unsigned integer a_value and the position of the bit a_bitPosition to be tested.
If the selected bit is enabled, the function returns true, otherwise false.

Parameters
a_valueUnsigned int value.
a_bitPositionBit position [0..31].
Returns
true if the selected bit is enabled, false otherwise.
unsigned int chai3d::cSetBit ( const unsigned int &  a_data,
const unsigned int &  a_bitPosition,
const bool  a_value 
)
inline

This function sets the value of a specified bit of an unsigned integer.
The function takes by argument an unsigned integer a_value, the position of the bit to be tested a_bitPosition, and its new value a_value as a boolean.
The function returns the modified unsigned integer as a result.

Parameters
a_dataInput unsigned integer data.
a_bitPositionBit position [0..31]
a_valueNew state of bit (true = 1, false = 0).
Returns
Input data with modified bit.
bool chai3d::cZero ( const double &  a_value)
inline

This function checks if a value passed by argument a_value is equal to or almost near zero.

Parameters
a_valueValue to be checked.
Returns
true if the value is equal to zero, false otherwise.
template<class T >
T chai3d::cAbs ( const T &  a_value)
inline

This function computes the absolute value of a value a_value passed by argument.

Parameters
a_valueInput value.
Returns
Absolute value.
template<class T >
double chai3d::cSign ( const T &  a_value)
inline

This function computes the sign of a value passed by argument a_value.

Parameters
a_valueValue to be evaluated.
Returns
1.0 if the value is zero or positive, -1.0 otherwise.
template<class T >
T chai3d::cMax ( const T &  a_value1,
const T &  a_value2 
)
inline

This function returns the maximum value between two values a_value1 and a_value2 passed by argument.

Parameters
a_value1First value.
a_value2Second value.
Returns
Maximum value between a_value1 and a_value2.
template<class T >
T chai3d::cMin ( const T &  a_value1,
const T &  a_value2 
)
inline

This function returns the minimum value between two values a_value1 and a_value2 passed by argument.

Parameters
a_value1First value.
a_value2Second value.
Returns
Minimum value between a_value1 and a_value2.
template<class T >
T chai3d::cMax3 ( const T &  a_value1,
const T &  a_value2,
const T &  a_value3 
)
inline

This function returns the maximum value between three values a_value1, a_value2, and a_value3 passed by argument.

Parameters
a_value1First value.
a_value2Second value.
a_value3Third value.
Returns
Maximum value between a_value1, a_value2, and a_value3.
template<class T >
T chai3d::cMin3 ( const T &  a_value1,
const T &  a_value2,
const T &  a_value3 
)
inline

This function returns the minimum value between three values a_value1, a_value2, and a_value3 passed by argument.

Parameters
a_value1First value.
a_value2Second value.
a_value3Third value.
Returns
Minimum value between a_value1, a_value2, and a_value3.
template<class T >
void chai3d::cSwap ( T &  a_value1,
T &  a_value2 
)
inline

This function swaps two elements a_value1 and a_value2 passed by argument.

Parameters
a_value1First value.
a_value2Second value.
template<class T >
T chai3d::cLerp ( const double &  a_level,
const T &  a_value1,
const T &  a_value2 
)
inline

This function computes a linear interpolation between values a_value1 (when a_level = 0.0) and a_value2 (when a_level = 1.0).

result = (1.0-a_level) * a_value1 + a_level * a_value2
Parameters
a_levelInterpolation factor ranging from 0.0 to 1.0.
a_value1First value.
a_value2Second value.
Returns
Interpolated value.
template<class T >
T chai3d::cClamp ( const T &  a_value,
const T &  a_low,
const T &  a_high 
)
inline

This function clamps an input value a_value to a specified range.
The range is specified by a lower bound a_low and upper bound a_high.

Parameters
a_valueValue to be clamped.
a_lowLower boundary value.
a_highUpper boundary value.
Returns
Clamped value.
template<class T >
T chai3d::cClamp0 ( const T &  a_value)
inline

This function clamps an input value a_value to a value ranged between 0 and infinity.

Parameters
a_valueValue to be clamped.
Returns
Clamped value.
double chai3d::cClamp01 ( const double &  a_value)
inline

This function clamps an input value a_value to a value ranged between 0.0 and 1.0.

Parameters
a_valueValue to be clamped.
Returns
Clamped value.
template<class T , class V >
bool chai3d::cContains ( const T &  a_value,
const V &  a_low,
const V &  a_high 
)
inline

This function checks whether a value a_value is within a range specified by arguments a_low and a_high.

Parameters
a_valueValue to be tested.
a_lowLower boundary value.
a_highUpper boundary value.
Returns
true if the value is within the specified range, false otherwise.
double chai3d::cSqr ( const double &  a_value)
inline

This function computes the square of a scalar a_value passed by argument.

result = a_value * a_value
Parameters
a_valueInput value.
Returns
Square of a_value.
double chai3d::cSqrt ( const double &  a_value)
inline

This function computes the square root of a scalar a_value passed by argument.

Parameters
a_valueInput value.
Returns
Square root of a_value.
double chai3d::cCbrt ( const double &  a_value)
inline

This function computes the cubic root of a scalar a_value passed by argument.

Parameters
a_valueInput value.
Returns
Cubic root of a_value.
double chai3d::cCosDeg ( const double &  a_angleDeg)
inline

This function computes the cosine of an angle defined in degrees.
The angle a_angleDeg is passed by argument.

Parameters
a_angleDegAngle in degrees.
Returns
Cosine of angle a_angleDeg.
double chai3d::cSinDeg ( const double &  a_angleDeg)
inline

This function computes the sine of an angle defined in degrees.
The angle a_angleDeg is passed by argument.

Parameters
a_angleDegAngle in degrees.
Returns
Sine of angle a_angleDeg.
double chai3d::cTanDeg ( const double &  a_angleDeg)
inline

This function computes the tangent of an angle defined in degrees.
The angle a_angleDeg is passed by argument.

Parameters
a_angleDegAngle in degrees.
Returns
Tangent of angle a_angleDeg.
double chai3d::cCosRad ( const double &  a_angleRad)
inline

This function computes the cosine of an angle defined in radians.
The angle a_angleRad is passed by argument.

Parameters
a_angleRadAngle in radians.
Returns
Cosine of angle a_angleRad.
double chai3d::cSinRad ( const double &  a_angleRad)
inline

This function computes the sine of an angle defined in radians.
The angle a_angleRad is passed by argument.

Parameters
a_angleRadAngle in radians.
Returns
Sine of angle a_angleRad.
double chai3d::cTanRad ( const double &  a_angleRad)
inline

This function computes the tangent of an angle defined in radians.
The angle a_angleRad is passed by argument.

Parameters
a_angleRadAngle in radians.
Returns
Tangent of angle a_angleRad.
double chai3d::cDegToRad ( const double &  a_angleDeg)
inline

This function converts an angle a_angleDeg expressed in degrees to an angle expressed in radians.

Parameters
a_angleDegAngle in degrees.
Returns
Converted angle in radians.
double chai3d::cRadToDeg ( const double &  a_angleRad)
inline

This function converts an angle a_angleRad expressed in radians to an angle expressed in degrees.

Parameters
a_angleRadAngle in radians.
Returns
Converted angle in degrees.
int chai3d::cNumDigits ( int  a_value)
inline

This function returns the number of digits that compose a given integer a_value passed by argument.

Parameters
a_valueValue to be evaluated.
Returns
Number of digits.
cVector3d chai3d::cAdd ( const cVector3d a_vector1,
const cVector3d a_vector2 
)
inline

This function computes the addition of two vectors.
The vectors are passed by argument as a_vector1 and a_vector2.

result = a_vector1 + a_vector2
Parameters
a_vector1First vector.
a_vector2Second vector.
Returns
Addition of two vectors.
cVector3d chai3d::cAdd ( const cVector3d a_vector1,
const cVector3d a_vector2,
const cVector3d a_vector3 
)
inline

This function computes the addition of three vectors.
The vectors are passed by argument as a_vector1, a_vector2, and a_vector3.

result = a_vector1 + a_vector2 + a_vector3
Parameters
a_vector1First vector.
a_vector2Second vector.
a_vector3Third vector.
Returns
Result of operation.
cVector3d chai3d::cSub ( const cVector3d a_vector1,
const cVector3d a_vector2 
)
inline

This function computes the subtraction of two vectors.
The vectors are passed by argument as a_vector1 and a_vector2.

result = a_vector1 - a_vector2
Parameters
a_vector1First vector.
a_vector2Second vector.
Returns
Result of operation.
cVector3d chai3d::cNegate ( const cVector3d a_vector)
inline

This function computes the negated vector of a vector a_vector passed by argument.

result = -a_vector
Parameters
a_vectorVector to be negated.
Returns
Negated vector.
cVector3d chai3d::cMul ( const double &  a_value,
const cVector3d a_vector 
)
inline

This function computes the multiplication of a vector by a scalar.
The vector a_vector and scalar a_scalar are passed by argument.

result = a_value * a_vector
Parameters
a_valueScalar.
a_vectorVector to be scaled.
Returns
Result of operation.
cVector3d chai3d::cDiv ( const double &  a_value,
const cVector3d a_vector 
)
inline

This function computes the division of a vector by a scalar.
The vector a_vector and scalar a_scalar are passed by argument.

result = (1.0 / a_value) * a_vector
Parameters
a_valueScalar.
a_vectorVector to be scaled.
Returns
Result of operation.
cVector3d chai3d::cCross ( const cVector3d a_vector1,
const cVector3d a_vector2 
)
inline

This function compute the cross product between two vectors.
Both vectors are passed by argument as a_vector1 and a_vector2.

result = a_vector1 x a_vector2
Parameters
a_vector1Vector1.
a_vector2Vector2.
Returns
Cross product between both vectors.
double chai3d::cDot ( const cVector3d a_vector1,
const cVector3d a_vector2 
)
inline

This function computes the dot product between two vectors.
Both vectors are passed by argument as a_vector1 and a_vector2.

result = a_vector1 * a_vector2
Parameters
a_vector1Vector1.
a_vector2Vector2.
Returns
Dot product between both vectors.
cVector3d chai3d::cNormalize ( const cVector3d a_vector)
inline

This function computes the normalized vector of a vector a_vector passed by argument.

Parameters
a_vectorVector to be normalized.
Returns
Normalized vector.
double chai3d::cDistance ( const cVector3d a_point1,
const cVector3d a_point2 
)
inline

This function computes the distance between two points a_point1 and a_point2 passed by argument.

Parameters
a_point1First point.
a_point2Second point.
Returns
Euclidean Distance between both points.
double chai3d::cDistanceSq ( const cVector3d a_point1,
const cVector3d a_point2 
)
inline

This function computes the squared distance between two points a_point1 and a_point2 passed by argument.

Parameters
a_point1First point.
a_point2Second point.
Returns
Squared distance between both points.
bool chai3d::cEqualPoints ( const cVector3d a_point1,
const cVector3d a_point2,
const double  a_epsilon = C_SMALL 
)
inline

This function determine whether two vectors represent the same point.
Both points, a_point1 and a_point2, are passed by argument.
A parameter a_epsilon defines the distance tolerance between both points such that if the computed distance is smaller than a_epsilon, then both points are considered to be equal.
The function returns true if both points are determined equal, or false otherwise.

Parameters
a_point1First point.
a_point2Second point.
a_epsilonDistance tolerance. Defaults value is set to C_SMALL.
Returns
true if both points are determined equal, false otherwise.
cMatrix3d chai3d::cIdentity3d ( void  )
inline

The function returns the identity matrix.

Returns
Identity matrix.
cMatrix3d chai3d::cAdd ( const cMatrix3d a_matrix1,
const cMatrix3d a_matrix2 
)
inline

The function computes the addition between two matrices a_matrix1 and a_matrix2 that are passed by argument.

result = a_matrix1 + a_matrix2
Parameters
a_matrix1First matrix.
a_matrix2Second matrix.
Returns
Result of operation.
cMatrix3d chai3d::cSub ( const cMatrix3d a_matrix1,
const cMatrix3d a_matrix2 
)
inline

This function computes the subtraction between two matrices a_matrix1 and a_matrix2 that are passed by argument.

result = a_matrix1 - a_matrix2
Parameters
a_matrix1First matrix.
a_matrix2Second matrixs.
Returns
Result of operation.
cMatrix3d chai3d::cRotEulerRad ( const double &  a_angleRad1,
const double &  a_angleRad2,
const double &  a_angleRad3,
const cEulerOrder  a_eulerOrder,
const bool  a_useIntrinsicEulerModel = true 
)
inline

This function creates a rotation matrix from a set of Euler angles defined in radians and co-moving axes of rotations.
The angles are defined in radians and passed by argument as a_angleRad1, a_angleRad2, and a_angleRad3.
The order of the rotations are defined by argument a_eulerOrder. See cEulerOrder for more information.
The argument a_useIntrinsicEulerModel defines if the instrinsic (true) or extrinsic (false) model is used.

Parameters
a_angleRad1Angle in radians of the first rotation in the sequence.
a_angleRad2Angle in radians of the second rotation in the sequence.
a_angleRad3Angle in radians of the third rotation in the sequence.
a_eulerOrderThe order of the axes about which the rotations are to be applied
a_useIntrinsicEulerModelIf true use intrinsic Euler model, if false use extrinsic Euler model.
Returns
Rotation matrix.
cMatrix3d chai3d::cRotEulerDeg ( const double &  a_angleDeg1,
const double &  a_angleDeg2,
const double &  a_angleDeg3,
const cEulerOrder  a_eulerOrder,
const bool  a_useIntrinsicEulerModel = true 
)
inline

This function creates a rotation matrix from a set of Euler angles defined in degrees and co-moving axes of rotations.
The angles are defined in radian and passed by argument as a_angleDeg1, a_angleDeg2, and a_angleDeg3.
The order of the rotations are defined by argument a_eulerOrder. See cEulerOrder for more information.
The argument a_useIntrinsicEulerModel defines if the instrinsic (true) or extrinsic (false) model is used.

Parameters
a_angleDeg1Angle in degrees of the first rotation in the sequence.
a_angleDeg2Angle in degrees of the second rotation in the sequence.
a_angleDeg3Angle in degrees of the third rotation in the sequence.
a_eulerOrderThe order of the axes about which the rotations are to be applied
a_useIntrinsicEulerModelIf true use intrinsic Euler model, if false use extrinsic Euler model.
Returns
Rotation matrix.
cMatrix3d chai3d::cRotAxisAngleRad ( const double &  a_axisX,
const double &  a_axisY,
const double &  a_axisZ,
const double &  a_angleRad 
)
inline

This function creates a rotation matrix from an axis-angle representation.
The axis is defined by arguments a_axisX, a_axisY, and a_axisZ. The rotation angle is defined in radians by argument a_angleRad.

Parameters
a_axisXx component of axis.
a_axisYy component of axis.
a_axisZz component of axis.
a_angleRadAngle of rotation in radians.
Returns
Rotation matrix.
cMatrix3d chai3d::cRotAxisAngleDeg ( const double &  a_axisX,
const double &  a_axisY,
const double &  a_axisZ,
const double &  a_angleDeg 
)
inline

This function creates a rotation matrix from an axis-angle representation.
The axis is defined by arguments a_axisX, a_axisY, and a_axisZ. The rotation angle is defined in degrees by argument a_angleDeg.

Parameters
a_axisXx component of axis.
a_axisYy component of axis.
a_axisZz component of axis.
a_angleDegAngle of roation in degrees.
Returns
Rotation matrix.
cMatrix3d chai3d::cMul ( const cMatrix3d a_matrix1,
const cMatrix3d a_matrix2 
)
inline

This function computes the multiplication of two matrices a_matrix1 and a_matrix2 passed by argument.

result = a_matrix1 * a_matrix2
Parameters
a_matrix1First matrix.
a_matrix2Second matrix.
Returns
Result of operation.
cVector3d chai3d::cMul ( const cMatrix3d a_matrix,
const cVector3d a_vector 
)
inline

This function computes the multiplication of a matrix a_matrix and a vector a_vector passed by argument.

result = a_matrix * a_vector
Returns
Result of operation.
cMatrix3d chai3d::cTranspose ( const cMatrix3d a_matrix)
inline

This function computes the transpose of a matrix a_matrix passed by argument.

Parameters
a_matrixMatrix to be transposed.
Returns
Transpose of a_matrix.
cMatrix3d chai3d::cInverse ( const cMatrix3d a_matrix)
inline

This function computes the the inverse of a matrix a_matrix passed by argument.

Parameters
a_matrixMatrix to be inversed.
Returns
The inverse of the matrix.
double chai3d::cAngle ( const cVector3d a_vector1,
const cVector3d a_vector2 
)
inline

This function computes the angle in radians between two vectors a_vector1 and a_vector2 passed by argument.

Parameters
a_vector1First vector.
a_vector2Second vector.
Returns
Angle in radians between both vectors.
double chai3d::cCosAngle ( const cVector3d a_vector1,
const cVector3d a_vector2 
)
inline

This function computes the cosine of the angle between two vectors a_vector1 and a_vector2 passed by argument.

Parameters
a_vector1First vector.
a_vector2Second vector.
Returns
Cosine of the angle between both vectors.
int chai3d::cSolveLinear ( double  a_coefficient[2],
double  a_solution[1] 
)
inline

This function determines the solution of a linear equation.
It takes as parameters a pointer to the two coefficient of the linear equation (the c[1] is the coefficient of x and so on) and a pointer to the two element array in which the solution is to be placed. It outputs is a solution has been found.

Parameters
a_coefficientInput coefficient values.
a_solutionOutput roots found.
Returns
The number of solutions found.
int chai3d::cSolveQuadric ( double  a_coefficient[3],
double  a_solution[2] 
)
inline

This function determines the roots of a quadric equation
It takes as parameters a pointer to the three coefficient of the quadric equation (the c[2] is the coefficient of x2 and so on) and a pointer to the two element array in which the roots are to be placed. It outputs the number of roots found.

Parameters
a_coefficientInput coefficient values.
a_solutionOutput roots found.
Returns
The number of roots found.
int chai3d::cSolveCubic ( double  a_coefficient[4],
double  a_solution[3] 
)
inline

This function determines the roots of a cubic equation.
It takes as parameters a pointer to the four coefficient of the cubic equation (the c[3] is the coefficient of x3 and so on) and a pointer to the three element array in which the roots are to be placed. It outputs the number of roots found.

Parameters
a_coefficientInput coefficient values.
a_solutionOutput roots found.
Returns
The number of roots found.
int chai3d::cSolveQuartic ( double  a_coefficient[5],
double  a_solution[4] 
)
inline

This function determines the roots of a quartic equation.
It takes as parameters a pointer to the five coefficient of the quartic equation (the c[4] is the coefficient of x^4 and so on) and a pointer to the four element array in which the roots are to be placed. It outputs the number of roots found.

Parameters
a_coefficientInput coefficient values.
a_solutionOutput roots found.
Returns
The number of roots found.