#include <rdMtx.h>
Static Public Member Functions | |
| double | Angle (const double *aV1, const double *aV2) |
| Find the angle between two vectors: theta = acos( aV1*aV2/(|aV1|*|aV2|)). | |
| double | Normalize (int aN, const double aV[], double rV[]) |
| Normalize a vector. | |
| double | Magnitude (int aN, const double aV[]) |
| Compute the magnitude of a vector. | |
| double | DotProduct (int aN, const double aV1[], const double aV2[]) |
| Compute the dot product of two vectors. | |
| int | CrossProduct (double *aV1, double *aV2, double *aV) |
| Compute the cross product of two vectors. | |
| void | Interpolate (int aN, double aT1, double *aY1, double aT2, double *aY2, double t, double *aY) |
| Linearly interpolate or extrapolate an array of data. | |
| double | Interpolate (double aT1, double aY1, double aT2, double aY2, double t) |
| Linearly interpolate or extrapolate two data points. | |
| void | Translate (double aX, double aY, double aZ, const double aP[3], double rP[3]) |
| Translate a point by a specified amount. | |
| void | Rotate (int aXYZ, double aRadians, const double aP[3], double rP[3]) |
| Rotate a point about the X, Y, or Z axis by a specified amount. | |
| void | Rotate (const double aAxis[3], double aRadians, const double aP[3], double rP[3]) |
| Rotate a point about a specified axis by a specified amount. | |
| void | RotateDeg (int aXYZ, double aDegrees, const double aP[3], double rP[3]) |
| Rotate a point about the X axis by a specified amount. | |
| void | RotateDeg (const double aAxis[3], double aDegrees, const double aP[3], double rP[3]) |
| Rotate a point about a specified axis by a specified amount. | |
| int | Identity (int aNR, double *rI) |
| Assign a square matrix to the identidy matrix: rI = I. | |
| int | Assign (int aNR, int aNC, double aScalar, double *rM) |
| Assign all elements of a matrix to a specified value: rMij = aScalar. | |
| int | Assign (int aNR, int aNC, const double *aM, double *rM) |
| Assign two matrices: rM = aM. | |
| int | Add (int aNR, int aNC, const double *aM1, double aScalar, double *aM) |
| Add a scalar to a matrix. | |
| int | Add (int aNR, int aNC, const double *aM1, const double *aM2, double *aM) |
| Add two matrices. | |
| int | Subtract (int aNR, int aNC, const double *aM1, const double *aM2, double *aM) |
| Subtract two matrices. | |
| int | Multiply (int aNR, int aNC, const double *aM, double aScalar, double *rM) |
| Multiply a matrix by a scalar. | |
| int | Multiply (int aNR1, int aNCR, int aNC2, const double *aM1, const double *aM2, double *aM) |
| Multiply two matrices. | |
| int | Invert (int aN, const double *aM, double *aMInv) |
| Compute the inverse of a matrix. | |
| int | Transpose (int aNR, int aNC, const double *aM, double *aMT) |
| Transpose a matrix. | |
| void | Print (int aNR, int aNC, const double *aM, int aPrecision=8) |
| Print a matrix. | |
| int | FindIndex (int aStartIndex, double aTime, int aNT, double *aT) |
| Starting at aIndex, move through the array aT and find the index of the element whose value is closest to but less than aTime. | |
| int | FindIndexLess (int aNX, double *aX, double aValue) |
| Scan from the beginning of the array, aX, and find the index of the element such that the element's value is less than or equal to aValue and the next element's value is greater than aValue. | |
| int | FindIndexGreater (int aNX, double *aX, double aValue) |
| Scan from the end of the array, aX, and find the index of the element such that the element's value is greater than or equal to aValue and such that the next element's value is less than aValue. | |
| int | ComputeIndex (int i2, int n1, int i1) |
| Compute the index for an element of a three dimensional matrix as though the matrix were laid out in one dimension. | |
| int | ComputeIndex (int i3, int n2, int i2, int n1, int i1) |
| Compute the index for an element of a three dimensional matrix as though the matrix were laid out in one dimension. | |
| void | GetDim3 (int n3, int n2, int n1, int i2, int i1, double *m, double *a) |
| Get elements *,i2,i1 of a three dimensional matrix as an array, where * varies along the 3rd dimension, i2 the 2nd, and i1 the 1st. | |
| void | SetDim3 (int n3, int n2, int n1, int i2, int i1, double *m, double *a) |
| Set elements *,i2,i1 of a three dimensional matrix to the values in array a, where * varies along the 3rd dimension, i2 the 2nd, and i1 the 1st. | |
| int | EnsureWorkSpaceCapacity (int aN) |
| Ensure that the work space is at least of size aN. | |
| int | EnsurePointerSpaceCapacity (int aN) |
| Ensure that the pointer spaces is at least of size aN. | |
| void | FreeWorkAndPointerSpaces () |
| Free the work and pointer spaces. | |
Static Private Attributes | |
| int | _PSpaceSize = 0 |
| int | _WSpaceSize = 0 |
| double ** | _P1Space = NULL |
| double ** | _P2Space = NULL |
| double * | _WSpace = NULL |
Most all the methods in this class are static.
|
||||||||||||||||||||||||
|
Add two matrices. If the arguments are not valid, then a -1 is returned. Othersise, 0 is returned. It is permissible for aM to coincide with either aM1 or aM2. |
|
||||||||||||||||||||||||
|
Add a scalar to a matrix. If the arguments are not valid, then a -1 is returned. Othersise, 0 is returned. It is permissible for aM to coincide with aM1. |
|
||||||||||||
|
Find the angle between two vectors: theta = acos( aV1*aV2/(|aV1|*|aV2|)).
|
|
||||||||||||||||||||
|
Assign two matrices: rM = aM.
|
|
||||||||||||||||||||
|
Assign all elements of a matrix to a specified value: rMij = aScalar. It is permissible for
|
|
||||||||||||||||
|
Compute the cross product of two vectors. If the arguments are not valid (aR=aS=NULL), -1 is returned. |
|
||||||||||||||||
|
Compute the dot product of two vectors. If the arguments are not valid (aV1=aV2=NULL), 0.0 is returned. |
|
|
Ensure that the pointer spaces is at least of size aN. If the capacity could not be increased to aN, -1 is returned. Otherwise, 0 is returned. |
|
|
Ensure that the work space is at least of size aN. If the capacity could not be increased to aN, -1 is returned. Otherwise, 0 is returned. |
|
||||||||||||||||||||
|
Starting at aIndex, move through the array aT and find the index of the element whose value is closest to but less than aTime. It is assumed that the array aT is monotonically increasing and has at least 2 elements. If aTime lies outside the interval of aT, the index of either the first point or second to last point is returned depending on whether aTime is below or above the interval of aT. -1 is if an error is encountered. |
|
||||||||||||||||
|
Scan from the end of the array, aX, and find the index of the element such that the element's value is greater than or equal to aValue and such that the next element's value is less than aValue. If no value in the array is less than aValue, the index of the first element in the array is returned. If no value in the array is greater than or equal to aValue, -1 is returned. |
|
||||||||||||||||
|
Scan from the beginning of the array, aX, and find the index of the element such that the element's value is less than or equal to aValue and the next element's value is greater than aValue. If no value in the array is greater than aValue, the index of the last element in the array is returned. If no value in the array is less than or equal to aValue, -1 is returned. |
|
||||||||||||||||||||||||||||||||
|
Get elements *,i2,i1 of a three dimensional matrix as an array, where * varies along the 3rd dimension, i2 the 2nd, and i1 the 1st. The first dimension is the dimension which varies most rapidly when the data is laid out in a one dimensional array, and the second dimension is the one which varies second most rapidly, and so on. For now, it is assumed that parameter a has enough memory allocated to hold the array. |
|
||||||||||||
|
Assign a square matrix to the identidy matrix: rI = I. The matrix must be square.
|
|
||||||||||||||||
|
Compute the inverse of a matrix. If the arguments are not valid (aM==NULL), then -1 is returned. If the matrix is not invertible, then -2 is returned. Othersise, 0 is returned. It is permissible for aM to overlap in memory with aMInv. |
|
||||||||||||
|
Compute the magnitude of a vector.
|
|
||||||||||||||||||||||||||||
|
Multiply two matrices. If the arguments are not valid (aM1,aM2,aM==NULL), then a -1 is returned. Othersise, 0 is returned. It is permissible for aM to overlap with either aM1 or aM2. |
|
||||||||||||||||||||||||
|
Multiply a matrix by a scalar. It is permissible for aM and rM to coincide in memory.
|
|
||||||||||||||||
|
Normalize a vector. If aV has a magnitude of zero, all elements of rV are set to 0.0. It is permissible for aV and rV to coincide in memory.
|
|
||||||||||||||||||||
|
Rotate a point about a specified axis by a specified amount.
|
|
||||||||||||||||||||
|
Rotate a point about the X, Y, or Z axis by a specified amount.
|
|
||||||||||||||||||||
|
Rotate a point about a specified axis by a specified amount.
|
|
||||||||||||||||||||
|
Rotate a point about the X axis by a specified amount.
|
|
||||||||||||||||||||||||||||||||
|
Set elements *,i2,i1 of a three dimensional matrix to the values in array a, where * varies along the 3rd dimension, i2 the 2nd, and i1 the 1st. The first dimension is the dimension which varies most rapidly when the data is laid out in a one dimensional array, and the second dimension is the one which varies second most rapidly, and so on. |
|
||||||||||||||||||||||||
|
Subtract two matrices. If the arguments are not valid, then a -1 is returned. Othersise, 0 is returned. It is permissible for aM to coincide with either aM1 or aM2. |
|
||||||||||||||||||||||||
|
Translate a point by a specified amount.
|
|
||||||||||||||||||||
|
Transpose a matrix. If the arguments are invalid (e.g.,aM==NULL), then a -1 is returned. Othersise, 0 is returned. It is permissible for aM to overlap in memory with aMT. |
1.3