#include <VcstMath.h>
|
static double | calculateMag (const double aVector[VEC_SIZE]) |
|
static double | calcQuatMag (const double aQuat[QUAT_SIZE]) |
|
static void | calculateCross (const double aUvector[VEC_SIZE], const double aVvector[VEC_SIZE], double anOutVector[VEC_SIZE]) |
|
static double | calculateDot (const double aUvector[VEC_SIZE], const double aVvector[VEC_SIZE]) |
|
static double | calculateDotQuat (const double aUquat[QUAT_SIZE], const double aVquat[QUAT_SIZE]) |
|
static void | applyScalar (const double aScalar, double aVector[VEC_SIZE]) |
|
static void | applyScalarQuat (const double aScalar, double aQuat[QUAT_SIZE]) |
|
static void | conjugateQuat (const double aQuat[QUAT_SIZE], double outQuat[QUAT_SIZE]) |
|
static void | quatMultiply (const double q1[QUAT_SIZE], const double q2[QUAT_SIZE], double outQuat[QUAT_SIZE]) |
|
static void | quatMultiplyMatrix (const double q1[QUAT_SIZE], const double q2[QUAT_SIZE], double outQuat[QUAT_SIZE]) |
|
static void | matrixMultiply (const double aM1[VEC_SIZE][VEC_SIZE], const double aM2[VEC_SIZE][VEC_SIZE], double outMatrix[VEC_SIZE][VEC_SIZE]) |
|
static void | matrixMultiply (const int dimM, const int dimN, const int dimP, const double *aMByN, const double *aNByP, double *outMatrix) |
|
static void | transposeMatrix (const double inMatrix[VEC_SIZE][VEC_SIZE], double outMatrix[VEC_SIZE][VEC_SIZE]) |
|
static void | transposeQuat (const double inQuat[QUAT_SIZE], double outQuat[QUAT_SIZE]) |
|
static void | printMatrixCOut (const double aMatrix[VEC_SIZE][VEC_SIZE]) |
|
static void | printVectorCOut (const double aVector[VEC_SIZE]) |
|
static void | printQuaternionCOut (const double aQuat[QUAT_SIZE]) |
|
static void | matrixVectorProduct (const double aMatrix[VEC_SIZE][VEC_SIZE], const double aVector[VEC_SIZE], double outVec[VEC_SIZE]) |
|
static void | calculateUnitVector (const double aVector[VEC_SIZE], double unitVector[VEC_SIZE]) |
|
static void | normalizeQuat (double aQuat[QUAT_SIZE]) |
|
static void | inverseMatrix (const double matA[VEC_SIZE][VEC_SIZE], double matR[VEC_SIZE][VEC_SIZE]) |
|
static void | rotationMatrix (const double angle, const short axis, double outMatrix[VEC_SIZE][VEC_SIZE]) |
|
static double | calculateDeterminant (const double matA[VEC_SIZE][VEC_SIZE]) |
|
static void | cofactorMatrix (const double matA[VEC_SIZE][VEC_SIZE], double cof[VEC_SIZE][VEC_SIZE]) |
|
The VcstMath class contains general math functions.
Definition at line 22 of file VcstMath.h.
◆ applyScalar()
static void applyScalar |
( |
const double |
aScalar, |
|
|
double |
aVector[VEC_SIZE] |
|
) |
| |
|
static |
This function will apply a scalar value to each component of a vector.
- Parameters
-
aScalar | Input scalar value |
aVector | Input/Output vector with scalar applied |
- Returns
- void
◆ applyScalarQuat()
static void applyScalarQuat |
( |
const double |
aScalar, |
|
|
double |
aQuat[QUAT_SIZE] |
|
) |
| |
|
static |
This function will apply a scalar value to each component of a quaternion.
- Parameters
-
aScalar | Input scalar value |
aQuat | Input/Output quaternion with scalar applied |
- Returns
- void
◆ calcQuatMag()
static double calcQuatMag |
( |
const double |
aQuat[QUAT_SIZE] | ) |
|
|
static |
This function computes the magnitude of a quaternion.
- Parameters
-
- Returns
- double
◆ calculateCross()
static void calculateCross |
( |
const double |
aUvector[VEC_SIZE], |
|
|
const double |
aVvector[VEC_SIZE], |
|
|
double |
anOutVector[VEC_SIZE] |
|
) |
| |
|
static |
This function produces the cross product of 2 vectors.
aUvector Input vector aVvector Input vector anOutVector Output cross product
- Returns
- PRO_SUCCESS or an error code
◆ calculateDeterminant()
static double calculateDeterminant |
( |
const double |
matA[VEC_SIZE][VEC_SIZE] | ) |
|
|
static |
This function calculates the determinant of a matrix.
- Parameters
-
- Returns
- double
◆ calculateDot()
static double calculateDot |
( |
const double |
aUvector[VEC_SIZE], |
|
|
const double |
aVvector[VEC_SIZE] |
|
) |
| |
|
static |
This function calculates the dot product of 2 vectors.
- Parameters
-
aUvector | Input vector |
aVvector | Input vector |
- Returns
- double
◆ calculateDotQuat()
static double calculateDotQuat |
( |
const double |
aUquat[QUAT_SIZE], |
|
|
const double |
aVquat[QUAT_SIZE] |
|
) |
| |
|
static |
This function calculates the dot product of 2 quaternions.
- Parameters
-
aUquat | Input quaternion |
aVquat | Input quaternion |
- Returns
- double
◆ calculateMag()
static double calculateMag |
( |
const double |
aVector[VEC_SIZE] | ) |
|
|
static |
This function computes the magnitude of a vector.
- Parameters
-
- Returns
- double
◆ calculateUnitVector()
static void calculateUnitVector |
( |
const double |
aVector[VEC_SIZE], |
|
|
double |
unitVector[VEC_SIZE] |
|
) |
| |
|
static |
This function creates a unit vector.
- Parameters
-
aVector | Input vector |
unitVector | Output unit vector |
- Returns
- Void
◆ cofactorMatrix()
static void cofactorMatrix |
( |
const double |
matA[VEC_SIZE][VEC_SIZE], |
|
|
double |
cof[VEC_SIZE][VEC_SIZE] |
|
) |
| |
|
static |
This function calculates the cofactor of a matrix.
- Parameters
-
matA | Input matrix |
cof | Output cofactor matrix |
- Returns
- Void
◆ conjugateQuat()
static void conjugateQuat |
( |
const double |
aQuat[QUAT_SIZE], |
|
|
double |
outQuat[QUAT_SIZE] |
|
) |
| |
|
static |
This function calculates the conjugate of a quaternion.
The conjugate of a quaternion Q, is Q* which has the property that Q X Q* = 1 using quaternion multiplication. Where 1 is the identity quaternion, or the real value 1.0. In quaternion notation (q1,q2,q3,q4) this is (0,0,0,1). The conjugate of a quaternion Q, is formed by reversing the signs of the vector part and not the scalar, so: Q* = (-q1, -q2, -q3, q4)
- Parameters
-
aQuat | Input quaternion Q |
outQuat | Output quaternion conjugate Q* |
- Returns
- Void
◆ inverseMatrix()
static void inverseMatrix |
( |
const double |
matA[VEC_SIZE][VEC_SIZE], |
|
|
double |
matR[VEC_SIZE][VEC_SIZE] |
|
) |
| |
|
static |
This function creates the inverse of a 3x3 matrix.
- Parameters
-
matA | Input matrix |
matR | Output inverse of input matrix |
- Returns
- Void
◆ matrixMultiply() [1/2]
static void matrixMultiply |
( |
const double |
aM1[VEC_SIZE][VEC_SIZE], |
|
|
const double |
aM2[VEC_SIZE][VEC_SIZE], |
|
|
double |
outMatrix[VEC_SIZE][VEC_SIZE] |
|
) |
| |
|
static |
This function will multiply two matrices together.
- Parameters
-
aM1 | Input matrix |
aM2 | Input matrix |
outMatrix | Output product of the 2 input matrices |
- Returns
- void
◆ matrixMultiply() [2/2]
static void matrixMultiply |
( |
const int |
dimM, |
|
|
const int |
dimN, |
|
|
const int |
dimP, |
|
|
const double * |
aMByN, |
|
|
const double * |
aNByP, |
|
|
double * |
outMatrix |
|
) |
| |
|
static |
This function will multiply two matrices (MByN NByP) together.
- Parameters
-
dimM | Input Dimension of M. |
dimN | Input Dimension of N. |
dimP | Input Dimension of P. |
aMByN | Input matrix |
aNByP | Input matrix |
outMatrix | Output product of the 2 input matrices |
- Returns
- void
◆ matrixVectorProduct()
static void matrixVectorProduct |
( |
const double |
aMatrix[VEC_SIZE][VEC_SIZE], |
|
|
const double |
aVector[VEC_SIZE], |
|
|
double |
outVec[VEC_SIZE] |
|
) |
| |
|
static |
This function multiplies a matrix times a vector.
- Parameters
-
aMatrix | Input matrix |
aVector | Input vector |
- Returns
- Void
◆ normalizeQuat()
static void normalizeQuat |
( |
double |
aQuat[QUAT_SIZE] | ) |
|
|
static |
This function normalizes a quaternion. This is the analog to calculateUnitVector() for quaternions. By definition, |Q| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1.
- Parameters
-
aQuat | Input/Output quaternion |
- Returns
- Void
◆ printMatrixCOut()
static void printMatrixCOut |
( |
const double |
aMatrix[VEC_SIZE][VEC_SIZE] | ) |
|
|
static |
This function will print the contents of a matrix. This method is for debugging and unit test only.
- Parameters
-
- Returns
- Void
◆ printQuaternionCOut()
static void printQuaternionCOut |
( |
const double |
aQuat[QUAT_SIZE] | ) |
|
|
static |
This function will print the contents of a quaternion. This method is for debugging and unit test only.
- Parameters
-
- Returns
- Void
◆ printVectorCOut()
static void printVectorCOut |
( |
const double |
aVector[VEC_SIZE] | ) |
|
|
static |
This function will print the contents of a vector. This method is for debugging and unit test only.
- Parameters
-
- Returns
- Void
◆ quatMultiply()
static void quatMultiply |
( |
const double |
q1[QUAT_SIZE], |
|
|
const double |
q2[QUAT_SIZE], |
|
|
double |
outQuat[QUAT_SIZE] |
|
) |
| |
|
static |
This function will multiply two quaternions together.
q1 Input quaternion q2 Input quaternion outQuat Output quaternion product
- Returns
- PRO_SUCCESS or an error code
◆ quatMultiplyMatrix()
static void quatMultiplyMatrix |
( |
const double |
q1[QUAT_SIZE], |
|
|
const double |
q2[QUAT_SIZE], |
|
|
double |
outQuat[QUAT_SIZE] |
|
) |
| |
|
static |
This alternate function will multiply two quaternions together using common matrix notation.
q1 Input quaternion q2 Input quaternion outQuat Output quaternion product
- Returns
- PRO_SUCCESS or an error code
◆ rotationMatrix()
static void rotationMatrix |
( |
const double |
angle, |
|
|
const short |
axis, |
|
|
double |
outMatrix[VEC_SIZE][VEC_SIZE] |
|
) |
| |
|
static |
This function creates a rotation matrix through the specified angle about the specified axis.
- Parameters
-
angle | Input angle of positive rotation |
axis | Input axis of positive rotation |
matR | Output rotation matrix |
- Returns
- Void
◆ transposeMatrix()
static void transposeMatrix |
( |
const double |
inMatrix[VEC_SIZE][VEC_SIZE], |
|
|
double |
outMatrix[VEC_SIZE][VEC_SIZE] |
|
) |
| |
|
static |
This function will transpose a matrix.
- Parameters
-
inMatrix | Input matrix |
outMatrix | Output transpose of input matrix |
- Returns
- void
◆ transposeQuat()
static void transposeQuat |
( |
const double |
inQuat[QUAT_SIZE], |
|
|
double |
outQuat[QUAT_SIZE] |
|
) |
| |
|
static |
This function will transpose a quaternion. NOTE: for quaternions, the transpose is the inverse. For the quaternion Q = q1 q2 q3 q4, the inverse is -Q = -q1 -q2 -q3 -q4
- Parameters
-
inQuat | Input quaternion |
outQuat | Output transpose of input quaternion |
- Returns
- void
The documentation for this class was generated from the following file:
- /gfs-oceanweb/web/ocssw/ocssw_src/include/ViirsCmn/VcstMath.h