#include <Rotation.h>
Inheritance diagram for O_SESSAME::DirectionCosineMatrix:
A simple way to describe and represent an Euler Angle sequence is by the use of a Direction Cosine Matrix (DCM). A DCM is a 3x3 matrix of values, a rotation matrix, that represent the transformation of a vector from one coordinate frame to another:
where and are the vectors in (Frame { a\/}) and respectively. is the DCM describing the rotation from to .
The direction cosine matrix is constructed by the components of the angles between the frame axes:
where is the cosine of the angle between the axis of the first frame and the axis of the second frame.
To determine successive rotations (say from to to ), we can simply combine the rotation matrices by multiplying them together:
DirectionCosineMatrix myEulerDCM(40*RPD, 20*RPD, -120*RPD, 312); // creates a 312 rotation DCM from 3 euler angles DirectionCosineMatrix myQuatDCM(myQuaternion); // where myQuaternion is an instance of Quaternion DirectionCosineMatrix myMRPDCM(myMRP); // where myMRP is an instance of ModifiedRodriguezParameters
and can also return the transformation in any of the representations. The successive and relative rotations between 2 DCMS can be computed:
dcm3 = dcm1 * dcm2; \\ successive rotation dcm3 = dcm1 + dcm2; \\ successive rotation dcm1 = dcm3 - dcm2; \\ relative rotation
dcmOI = ~dcmIO;
The DirectionCosineMatrix class is derived from Matrix, so therefore includes all of the functionality of the Matrix class. This includes subarray accessing, element accessing, multiplication, addition (except where redefined by the subclass).
double element11 = dcm1(MatrixBaseIndex + 0, MatrixBaseIndex + 0); Vector column2 = dcm1(_,MatrixBaseIndex+1);
Definition at line 138 of file Rotation.h.
Public Member Functions | |
DirectionCosineMatrix () | |
Create a DCM equal to the identity matrix [1,0,0;0,1,0;0,0,1]. | |
DirectionCosineMatrix (const DirectionCosineMatrix &_DCM) | |
Create a copy of a DCM from an existing DCM. | |
DirectionCosineMatrix (const Matrix &_DCM) | |
Create a copy of a DCM from an existing matrix of DCM values. | |
DirectionCosineMatrix (const Vector &_EulerAngles, const int &_Sequence) | |
Create a Direction Cosine Matrix (DCM) from Euler Angles. | |
DirectionCosineMatrix (const Vector &_EulerAxis, const Angle &_EulerAngle) | |
Create a Direction Cosine Matrix (DCM) from an Euler Axis and rotation. | |
DirectionCosineMatrix (const Angle &_Angle1, const Angle &_Angle2, const Angle &_Angle3, const int &_Sequence) | |
Create a Direction Cosine Matrix (DCM) from Euler Angles. | |
DirectionCosineMatrix (const ModifiedRodriguezParameters &_MRP) | |
Create a Direction Cosine Matrix (DCM) from a vector of Modified Rodriguez Parameters (MRP). | |
DirectionCosineMatrix (const Quaternion &_quat) | |
Create a Direction Cosine Matrix (DCM) from a quaternion. | |
virtual | ~DirectionCosineMatrix () |
Default deconstructor. | |
void | Set (const DirectionCosineMatrix &_DCM) |
Set a DCM to a copy of another DCM. | |
void | Set (const Matrix &_DCM) |
Set a DCM to a copy of an matrix that is a DCM. | |
void | Set (const Vector &_EulerAngles, const int &_Sequence) |
Set the DCM to the transformation of set of Euler Angles. | |
void | Set (const Angle &_Angle1, const Angle &_Angle2, const Angle &_Angle3, const int &_Sequence) |
Set the DCM to the transformation of set of Euler Angles. | |
void | Set (const Vector &_EulerAxis, const Angle &_EulerAngle) |
Set the DCM to the transformation of an Euler Axis and Angle. | |
void | Set (const ModifiedRodriguezParameters &_MRP) |
Set the DCM to the transformation of Modified Rodriguez Paramaters (MRP). | |
void | Set (const Quaternion &_qIn) |
Set a DCM to the transformation of a quaternion. | |
Vector | GetEulerAngles (const int &_Sequence) const |
Convert a DCM to a set of Euler Angles. | |
void | GetEulerAxisAngle (Vector &_EulerAxis, Angle &_EulerAngle) const |
Convert the DCM to an Euler Axis and Angle. | |
ModifiedRodriguezParameters | GetMRP () const |
Convert a DCM to an MRP representation. This conversion is performed by creating a new instance of an MRP from this DCM. (. | |
Quaternion | GetQuaternion () const |
Convert a DCM to a quaternion representation. This conversion is performed by creating a new instance of a Quaternion from this DCM. (. | |
void | Normalize () |
Normalize the Direction Cosine Matrix. This member function normalizes and stores the DCM. Normalization is performed by dividing each element in a column by the square-root of the sum of the squares of a column. . | |
DirectionCosineMatrix | operator+ (const DirectionCosineMatrix &_DCM2) const |
Determine the successive rotation from the summation of two DCMs. | |
DirectionCosineMatrix | operator- (const DirectionCosineMatrix &_DCM2) const |
Determine the relative rotation from the difference of two DCMs. | |
DirectionCosineMatrix | operator * (DirectionCosineMatrix _DCM2) const |
Determine the successive rotation of the DCMs through multiplication. | |
Vector | operator * (const Vector &_vec) const |
Determine the rotation of a vector by a DCM. | |
DirectionCosineMatrix | operator~ () |
Determines the inverse of a DCM by taking the transpose (same operation). | |
void | initialize () |
void | initialize (const CAMdoubleMatrix &A) |
void | initialize (const CAMmatrixBase &A) |
void | initialize (const CAMrange &R1, const CAMrange &R2) |
void | initialize (int d_type) |
void | initialize (int d_type, const CAMrange &R1, const CAMrange &R2) |
double & | operator() (long i1, long i2) |
const double & | operator() (long i1, long i2) const |
const CAMdoubleMatrix | operator() (const CAMrange &R1, const CAMrange &R2) const |
CAMdoubleMatrix | operator() (const CAMrange &R1, const CAMrange &R2) |
double * | getDataPointer () const |
void * | getDataPointer (long i1, long i2) const |
CAMmatrixBase | operator- () const |
CAMmatrixBase | operator- (const CAMmatrixBase &A) const |
CAMmatrixBase | operator- (const CAMvectorBase &A) const |
CAMmatrixBase | operator- (const double value) const |
CAMmatrixBase | operator+ (const CAMmatrixBase &A) const |
CAMmatrixBase | operator+ (const CAMvectorBase &A) const |
CAMmatrixBase | operator+ (const double value) const |
CAMmatrixBase | operator * (const CAMmatrixBase &A) const |
CAMvectorBase | operator * (const CAMvectorBase &A) const |
CAMmatrixBase | operator * (double value) const |
CAMmatrixBase | operator/ (const CAMmatrixBase &A) const |
CAMvectorBase | operator/ (const CAMvectorBase &A) const |
CAMmatrixBase | operator/ (double value) const |
void | operator+= (const CAMmatrixBase &A) |
void | operator+= (const CAMvectorBase &A) |
void | operator+= (const double value) |
void | operator-= (const CAMmatrixBase &A) |
void | operator-= (const CAMvectorBase &A) |
void | operator-= (const double value) |
void | operator *= (const CAMmatrixBase &A) |
void | operator *= (const CAMvectorBase &A) |
void | operator *= (double value) |
void | operator/= (const CAMmatrixBase &A) |
void | operator/= (const CAMvectorBase &A) |
void | operator/= (double value) |
CAMmatrixBase | transpose () const |
CAMmatrixBase | operator~ () const |
void | setToValue (double value) |
CAMmatrixBase | plusValue (double value) |
CAMmatrixBase | minusValue (double value) |
void | setTemporaryFlag () |
void | initializeReturnArgument (const CAMstructureBase &S, int dataT) |
void | initializeReturnArgument (const CAMmatrixBase &A) |
void | initializeMinDuplicate (const CAMmatrixBase &A) |
CAMarrayBase | asArray () const |
CAMvectorBase | asVector () const |
const CAMstructureBase & | operator[] (long i) const |
CAMstructureBase & | operator[] (long i) |
void | setAllIndexBase (long i) |
long | getDimension () const |
void | incrementReferenceCount () |
void | decrementReferenceCount () |
int | getReferenceCount () const |
void | setReferenceCount (int refValue) |
double | max () const |
double | min () const |
double | maxAbs () const |
double | minAbs () const |
double | infNorm () const |
double | pNorm (int p) const |
double | pNorm (long p) const |
double | pNorm (float p) const |
double | pNorm (double p) const |
CAMmatrixBase | inverse () const |
void | exchangeContentsWith (CAMmatrixBase &B) |
void | initializeReferenceDuplicate (const CAMmatrixBase &B) |
Static Public Member Functions | |
CAMdoubleMatrix | identity (long n) |
void | referenceCountError () |
void | indexCheck (const CAMstructureBase &S, long i1, long i2) |
void | indexErrorMessage (long indexDimension, long base, long bound, long index) |
void | nonConformingMessage (const CAMstructureBase &A, const CAMstructureBase &B) |
void | doubleConversionError (const CAMstructureBase &A) |
void | nonSquareMessage () |
void | objectConversionError (const CAMstructureBase &A) |
void | nullOperandError () |
void | nullOperandError (char *Operation) |
void | inputSizeError () |
Public Attributes | |
CAMstructureBase | Structure |
CAMdataHandler * | DataP |
int | typeValue |
int | referenceFlag |
long | matrixBaseReferenceCount |
Friends | |
class | CAMvectorBase |
__IMPEXP__ friend ostream & | operator<< (ostream &out_stream, const CAMmatrixBase &A) |
__IMPEXP__ friend istream & | operator>> (istream &in_stream, CAMmatrixBase &A) |
__IMPEXP__ friend CAMmatrixBase | operator- (const double value, const CAMmatrixBase &A) |
__IMPEXP__ friend CAMmatrixBase | operator+ (const double value, const CAMmatrixBase &A) |
__IMPEXP__ friend CAMmatrixBase | operator * (double value, const CAMmatrixBase &A) |
__IMPEXP__ friend CAMmatrixBase | operator/ (double value, const CAMmatrixBase &A) |
|
Create a DCM equal to the identity matrix [1,0,0;0,1,0;0,0,1].
Definition at line 281 of file Rotation.cpp. |
|
Create a copy of a DCM from an existing DCM.
Definition at line 288 of file Rotation.cpp. |
|
Create a copy of a DCM from an existing matrix of DCM values.
Definition at line 295 of file Rotation.cpp. |
|
Create a Direction Cosine Matrix (DCM) from Euler Angles.
Definition at line 304 of file Rotation.cpp. |
|
Create a Direction Cosine Matrix (DCM) from an Euler Axis and rotation.
Definition at line 324 of file Rotation.cpp. |
|
Create a Direction Cosine Matrix (DCM) from Euler Angles.
Definition at line 315 of file Rotation.cpp. |
|
Create a Direction Cosine Matrix (DCM) from a vector of Modified Rodriguez Parameters (MRP).
Definition at line 332 of file Rotation.cpp. |
|
Create a Direction Cosine Matrix (DCM) from a quaternion.
Definition at line 340 of file Rotation.cpp. |
|
Default deconstructor.
Definition at line 346 of file Rotation.cpp. |
|
Set a DCM to a copy of another DCM.
Definition at line 353 of file Rotation.cpp. |
|
Set a DCM to a copy of an matrix that is a DCM.
Definition at line 365 of file Rotation.cpp. |
|
Set the DCM to the transformation of set of Euler Angles.
Definition at line 378 of file Rotation.cpp. |
|
Set the DCM to the transformation of set of Euler Angles.
Definition at line 390 of file Rotation.cpp. |
|
Set the DCM to the transformation of an Euler Axis and Angle.
Definition at line 428 of file Rotation.cpp. |
|
Set the DCM to the transformation of Modified Rodriguez Paramaters (MRP).
Definition at line 471 of file Rotation.cpp. |
|
Set a DCM to the transformation of a quaternion.
Definition at line 515 of file Rotation.cpp. |
|
Convert a DCM to a set of Euler Angles.
Definition at line 550 of file Rotation.cpp. |
|
Convert the DCM to an Euler Axis and Angle.
Definition at line 569 of file Rotation.cpp. |
|
Convert a DCM to an MRP representation. This conversion is performed by creating a new instance of an MRP from this DCM. (.
Definition at line 597 of file Rotation.cpp. |
|
Convert a DCM to a quaternion representation. This conversion is performed by creating a new instance of a Quaternion from this DCM. (.
Definition at line 607 of file Rotation.cpp. |
|
Normalize the Direction Cosine Matrix. This member function normalizes and stores the DCM. Normalization is performed by dividing each element in a column by the square-root of the sum of the squares of a column. .
Definition at line 617 of file Rotation.cpp. |
|
Determine the successive rotation from the summation of two DCMs.
Definition at line 637 of file Rotation.cpp. |
|
Determine the relative rotation from the difference of two DCMs.
Definition at line 646 of file Rotation.cpp. |
|
Determine the successive rotation of the DCMs through multiplication.
Definition at line 654 of file Rotation.cpp. |
|
Determine the rotation of a vector by a DCM.
Definition at line 662 of file Rotation.cpp. |
|
Determines the inverse of a DCM by taking the transpose (same operation).
Definition at line 670 of file Rotation.cpp. |
|
Reimplemented from CAMmatrixBase. |
|
|
|
Reimplemented from CAMmatrixBase. |
|
|
|
Definition at line 255 of file matbse.cpp. |
|
Definition at line 299 of file matbse.cpp. |
|
|
|
|
|
|
|
|
|
Reimplemented from CAMmatrixBase. |
|
Definition at line 1397 of file matbse.cpp. |
|
Definition at line 8 of file dmatrix.cpp. |
|
Definition at line 385 of file matbse.cpp. |
|
Definition at line 431 of file matbse.cpp. |
|
Definition at line 447 of file matbse.cpp. |
|
Definition at line 1105 of file matbse.cpp. |
|
Definition at line 398 of file matbse.cpp. |
|
Definition at line 415 of file matbse.cpp. |
|
Definition at line 1074 of file matbse.cpp. |
|
Definition at line 463 of file matbse.cpp. |
|
Definition at line 556 of file matbse.cpp. |
|
Definition at line 1161 of file matbse.cpp. |
|
Definition at line 651 of file matbse.cpp. |
|
Definition at line 793 of file matbse.cpp. |
|
Definition at line 1183 of file matbse.cpp. |
|
Definition at line 944 of file matbse.cpp. |
|
Definition at line 960 of file matbse.cpp. |
|
Definition at line 1137 of file matbse.cpp. |
|
Definition at line 970 of file matbse.cpp. |
|
Definition at line 980 of file matbse.cpp. |
|
Definition at line 1149 of file matbse.cpp. |
|
Definition at line 990 of file matbse.cpp. |
|
Definition at line 997 of file matbse.cpp. |
|
Definition at line 1205 of file matbse.cpp. |
|
Definition at line 1005 of file matbse.cpp. |
|
Definition at line 1013 of file matbse.cpp. |
|
Definition at line 1213 of file matbse.cpp. |
|
Definition at line 1021 of file matbse.cpp. |
|
Definition at line 1045 of file matbse.cpp. |
|
Definition at line 1220 of file matbse.cpp. |
|
Definition at line 1228 of file matbse.cpp. |
|
Definition at line 1239 of file matbse.cpp. |
|
|
|
Definition at line 329 of file matbse.cpp. |
|
Definition at line 323 of file matbse.cpp. |
|
Definition at line 335 of file matbse.cpp. |
|
Definition at line 1317 of file matbse.cpp. |
|
Definition at line 1333 of file matbse.cpp. |
|
Definition at line 1387 of file matbse.cpp. |
|
Definition at line 1377 of file matbse.cpp. |
|
|
|
|
|
Definition at line 1419 of file matbse.cpp. |
|
|
|
|
|
|
|
Definition at line 1425 of file matbse.cpp. |
|
Definition at line 1437 of file matbse.cpp. |
|
Definition at line 1462 of file matbse.cpp. |
|
Definition at line 1470 of file matbse.cpp. |
|
Definition at line 1487 of file matbse.cpp. |
|
Definition at line 1500 of file matbse.cpp. |
|
Definition at line 1507 of file matbse.cpp. |
|
Definition at line 1519 of file matbse.cpp. |
|
Definition at line 1525 of file matbse.cpp. |
|
Definition at line 1531 of file matbse.cpp. |
|
Definition at line 13 of file matutl.cpp. |
|
Definition at line 39 of file matutl.cpp. |
|
Definition at line 65 of file matutl.cpp. |
|
Definition at line 91 of file matutl.cpp. |
|
Definition at line 118 of file matutl.cpp. |
|
Definition at line 170 of file matutl.cpp. |
|
Definition at line 171 of file matutl.cpp. |
|
Definition at line 172 of file matutl.cpp. |
|
Definition at line 144 of file matutl.cpp. |
|
Definition at line 178 of file matutl.cpp. |
|
Definition at line 1255 of file matbse.cpp. |
|
Definition at line 1286 of file matbse.cpp. |
|
|
|
Definition at line 184 of file matbse.cpp. |
|
Definition at line 214 of file matbse.cpp. |
|
Definition at line 1121 of file matbse.cpp. |
|
Definition at line 1089 of file matbse.cpp. |
|
Definition at line 1172 of file matbse.cpp. |
|
Definition at line 1194 of file matbse.cpp. |
|
|
|
|
|
|
|
|
|
|