# CSIBCRotMatd Class Reference

Representation of a 3X3 rotation matrix. More...

`#include <SIBCRotMatd.h>`

Inheritance diagram for CSIBCRotMatd:

List of all members.

## Public Member Functions
| CSIBCRotMatd (void)
| CSIBCRotMatd (const CSIBCVector3Dd &in_vct0, const CSIBCVector3Dd &in_vct1, const CSIBCVector3Dd &in_vct2, const bool in_bAreRows=true)
| CSIBCRotMatd (const double in_dA00, const double in_dA01, const double in_dA02, const double in_dA10, const double in_dA11, const double in_dA12, const double in_dA20, const double in_dA21, const double in_dA22)
double | Get (const int in_nRow, const int in_nCol) const
CSIBCRotMatd & | Set (int in_nRow, int in_nCol, const double in_dVal)
CSIBCRotMatd & | Set (double in_dVal[3][3])
CSIBCRotMatd & | Set (const CSIBCMatrix33d &in_mat)
CSIBCRotMatd & | Set (const CSIBCRotMatd &in_mat)
CSIBCRotMatd & | Set (const E3DAxisType in_axis, const double in_dAngle)
CSIBCRotMatd & | SetRow (const int in_nRow, const CSIBCVector3Dd &in_vct)
CSIBCRotMatd & | SetRow (const int in_nRow, double in_dA0, double in_dA1, double in_dA2)
CSIBCRotMatd & | SetCol (const int in_nCol, const CSIBCVector3Dd &in_vct)
CSIBCRotMatd & | SetCol (const int in_nCol, double in_dA0, double in_dA1, double in_dA2)
CSIBCRotMatd & | SetNull ()
CSIBCRotMatd & | SetIdentity (void)
bool | operator== (const CSIBCMatrix33d &in_mat) const
bool | operator!= (const CSIBCMatrix33d &in_mat) const
CSIBCRotMatd & | Mul (const CSIBCRotMatd &in_mat1, const CSIBCRotMatd &in_mat2)
CSIBCRotMatd & | Mul (const CSIBCRotMatd &in_mat)
CSIBCRotMatd & | MulTransByReg (const CSIBCRotMatd &in_mat1, const CSIBCRotMatd &in_mat2)
CSIBCRotMatd & | MulRegByTrans (const CSIBCRotMatd &in_mat1, const CSIBCRotMatd &in_mat2)
CSIBCRotMatd & | Negate (const CSIBCRotMatd &in_mat)
CSIBCRotMatd & | Negate ()
double | GetDet (void) const
double | GetTrace (void) const
CSIBCRotMatd & | Transpose (const CSIBCRotMatd &in_mat)
CSIBCRotMatd & | Transpose (void)
CSIBCRotMatd & | Invert (const CSIBCRotMatd &in_mat)
CSIBCRotMatd & | Invert (void)
## Friends
bool | AreAlmostEqual (const CSIBCRotMatd &in_mat1, const CSIBCRotMatd &in_mat2, const double in_dEpsilon=PICO_EPS)

## Detailed Description

Representation of a 3X3 rotation matrix.

CSIBCRotMatd is a specialzed 3X3 matrix that represents rotations. It uses double precision-floating point numbers to represent elements in the matrix.

There are several other classes which represent rotations, most notably CSIBCRotationd, which represents a general rotation class, not specific to matricies, quaternions (see CSIBCQuaternion and CSIBCQuaterniond), etc. Several useful functions for rotations can be found in Utility functions for angles and rotations.

There are several other matrix classes aswell. Classes with specific applications, such as CSIBCXfoMatd used for representing transformation matricies, Other matrix classes are not as specialized as CSIBCRotMatd or CSIBCXfoMatd, and are used to represent general matricies. These classes include CSIBCMatrix4x4, CSIBCMatrix44d and CSIBCMartrix33d.

## Constructor & Destructor Documentation

CSIBCRotMatd | ( | void |  | ) |

Default Constructor. Constructs a rotation matrix representing the identity rotation (meaning no rotation at all).

See also:
  CSIBCRotMatd::SetIdentity

CSIBCRotMatd | ( | const CSIBCVector3Dd & | in_vct0,
|  | const CSIBCVector3Dd & | in_vct1,
|  | const CSIBCVector3Dd & | in_vct2,
|  | const bool | in_bAreRows = `true` |
| ) |  |  |

Constructor. Sets the rows of the new matrix to be `in_vct0`, `in_vct1`, and `in_vct2`. If `in_bAreRows` is false, then the input vectors are used as the columns of the new matrix. The user is responsible for ensuring that the vectors given represent a possible rotation matrix (vectors are unit vectors, orthogonal to each other).

Parameters:

  | in_vct0 | The vector to use for the first row (or column) of the matrix.
  | in_vct1 | The vector to use for the second row (or column) of the matrix.
  | in_vct2 | The vector to use for the third row (or column) of the matrix.
  | in_bAreRows | Whether the vectors given represent rows or columns of the matrix (true == Rows, false == Columns). Defaults to true (rows).

CSIBCRotMatd | ( | const double | in_dA00,
|  | const double | in_dA01,
|  | const double | in_dA02,
|  | const double | in_dA10,
|  | const double | in_dA11,
|  | const double | in_dA12,
|  | const double | in_dA20,
|  | const double | in_dA21,
|  | const double | in_dA22 |
| ) |  |  |

Constructor. Specifies the value of each element in the new matrix. The user is responsible for ensuring that the elements given represent a possible rotation matrix (rows must represent unit vectors, and be orthogonal to each other).

Parameters:

  | in_dA00 | The value for the element in row 1, column 1.
  | in_dA01 | The value for the element in row 1, column 2
  | in_dA02 | The value for the element in row 1, column 3
  | in_dA10 | The value for the element in row 2, column 1.
  | in_dA11 | The value for the element in row 2, column 2
  | in_dA12 | The value for the element in row 2, column 3
  | in_dA20 | The value for the element in row 3, column 1.
  | in_dA21 | The value for the element in row 3, column 2
  | in_dA22 | The value for the element in row 3, column 3

## Member Function Documentation

double Get | ( | const int | in_nRow,
|  | const int | in_nCol |
| ) |  |  | const

Returns an element of the marix.

Parameters:

  | in_nRow | Row index of the element to retrieve (zero indexed).
  | in_nCol | Column index of the element to retrieve (zero indexed).

Returns:
  double The value of the element at the given matrix position.

See also:
  CSIBCRotMatd::Set(int, int, const double)

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Set | ( | int | in_nRow,
|  | int | in_nCol,
|  | const double | in_dVal |
| ) |  |  |

Sets an element of the matrix.

Parameters:

  | in_nRow | Row index of the element to set (zero indexed).
  | in_nCol | Column index of the element to set (zero indexed).

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Set | ( | double | in_dVal[3][3] | ) |

Sets all elements of the matrix.

Parameters:

  | in_dVal | 3x3 array of double values, containing the new values for all the matrix elements.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Set | ( | const CSIBCMatrix33d & | in_mat | ) |

Sets all elements of the matrix to those contained in `in_mat`.

Parameters:

  | in_mat | Matrix to copy all element values from.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Set | ( | const CSIBCRotMatd & | in_mat | ) |

Sets all elements of the matrix to those contained in `in_mat`.

Parameters:

  | in_mat | Matrix to copy all element values from.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

CSIBCRotMatd& Set | ( | const E3DAxisType | in_axis,
|  | const double | in_dAngle |
| ) |  |  |

Sets the rotation matrix to be a rotation about the major axis `in_axis`, of `in_dAngle` radians.

Parameters:

  | in_axis | The major axis for the rotation matrix.
  | in_dAngle | Angle of rotation about the major axis, in radians. CSIBCRotMatd& Reference to this matrix.

CSIBCRotMatd& SetRow | ( | const int | in_nRow,
|  | const CSIBCVector3Dd & | in_vct |
| ) |  |  |

Sets all elements in a row of the matrix.

Parameters:

  | in_nRow | Row index of the row to set (zero indexed).
  | in_vct | Vector containing the values to replace the specified row elements with.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& SetRow | ( | const int | in_nRow,
|  | double | in_dA0,
|  | double | in_dA1,
|  | double | in_dA2 |
| ) |  |  |

Sets all elements in a row of the matrix.

Parameters:

  | in_nRow | Row index of the row to set (zero indexed).
  | in_dA0 | Value for the element in the first column of the row.
  | in_dA1 | Value for the element in the second column of the row.
  | in_dA2 | Value for the element in the third column of the row.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& SetCol | ( | const int | in_nCol,
|  | const CSIBCVector3Dd & | in_vct |
| ) |  |  |

Sets all elements in a column of the matrix.

Parameters:

  | in_nCol | Column index of the column to set (zero indexed).
  | in_vct | Vector containing the values to replace the specified column elements with.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& SetCol | ( | const int | in_nCol,
|  | double | in_dA0,
|  | double | in_dA1,
|  | double | in_dA2 |
| ) |  |  |

Sets all elements in a column of the matrix.

Parameters:

  | in_nCol | Column index of the column to set (zero indexed).
  | in_dA0 | Value for the element in the first row of the column.
  | in_dA1 | Value for the element in the second row of the column.
  | in_dA2 | Value for the element in the third row of the column.

See also:
  CSIBCRotMatd::Set

  CSIBCRotMatd::SetRow

  CSIBCRotMatd::SetCol

  CSIBCRotMatd::Get

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& SetNull | ( |  | ) |

Sets all elements in the matrix to zero.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::SetIdentity

  CSIBCRotMatd::Set

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& SetIdentity | ( | void |  | ) |

Sets this matrix to be the identity rotation matrix.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::SetNull

  CSIBCRotMatd::Set

Reimplemented from CSIBCMatrix33d.

bool operator== | ( | const CSIBCMatrix33d & | in_mat | ) | const

Determines whether all corresponding elements of this matrix and `in_mat` are exactly equal.

Parameters:

  | in_mat | The matrix to compare equality with.

Returns:
  bool true if the matricies are exactly equal, false otherwise.

See also:
  CSIBCRotMatd::AreAlmostEqual

  CSIBCRotMatd::operator!=

Reimplemented from CSIBCMatrix33d.

bool operator!= | ( | const CSIBCMatrix33d & | in_mat | ) | const

Determines whether any corresponding elements of this matrix and `in_mat` are different.

Parameters:

  | in_mat | The matrix to compare inequality with.

Returns:
  bool true if the matricies differ in any element, false otherwise.

See also:
  CSIBCRotMatd::AreAlmostEqual

  CSIBCRotMatd::operator==

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Mul | ( | const CSIBCRotMatd & | in_mat1,
|  | const CSIBCRotMatd & | in_mat2 |
| ) |  |  |

Computes the matrix multiplication of two matricies (`in_mat1` * `in_mat2`) and stores the result in this matrix.

Parameters:

  | in_mat1 | The first matrix in the multiplication (on the left).
  | in_mat2 | The second matrix in the multiplication (on the right).

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Mul

  CSIBCRotMatd::MulTransByReg

  CSIBCRotMatd::MulRegByTrans

  CSIBCRotMatd::Div

CSIBCRotMatd& Mul | ( | const CSIBCRotMatd & | in_mat | ) |

Computes the matrix multiplication of this matrix and `in_mat` (`this` * `in_mat`) and stores the result in this matrix.

Parameters:

  | in_mat | The matrix to right-multiply this matrix by.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Mul

  CSIBCRotMatd::MulTransByReg

  CSIBCRotMatd::MulRegByTrans

  CSIBCRotMatd::Div

CSIBCRotMatd& MulTransByReg | ( | const CSIBCRotMatd & | in_mat1,
|  | const CSIBCRotMatd & | in_mat2 |
| ) |  |  |

Computes the matrix multiplication of the transpose of `in_mat1` and `in_mat2` (`in_mat1^T` * `in_mat2`) and stores the result in this matrix.

Parameters:

  | in_mat1 | The first matrix in the multiplication (on the left), to be transposed before multiplication.
  | in_mat2 | The second matrix in the multiplication (on the right).

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Mul

  CSIBCRotMatd::MulRegByTrans

  CSIBCRotMatd::Div

CSIBCRotMatd& MulRegByTrans | ( | const CSIBCRotMatd & | in_mat1,
|  | const CSIBCRotMatd & | in_mat2 |
| ) |  |  |

Computes the matrix multiplication of `in_mat1` and the transpose of `in_mat2` (`in_mat1` * `in_mat2^T`) and stores the result in this matrix.

Parameters:

  | in_mat1 | The first matrix in the multiplication (on the left).
  | in_mat2 | The second matrix in the multiplication (on the right), to be transposed before multiplication.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Mul

  CSIBCRotMatd::MulTransByReg

  CSIBCRotMatd::Div

CSIBCRotMatd& Negate | ( | const CSIBCRotMatd & | in_mat | ) |

Sets this matrix to the negative of `in_mat`. The 'negative' of a matrix is produced by multiplying each element of the matrix by -1.

Parameters:

  | in_mat | Matrix containing the data to set this matrix to the negative of.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Negate()

CSIBCRotMatd& Negate | ( |  | ) |

Sets this matrix to its negative. The 'negative' of a matrix is produced by multiplying each element of the matrix by -1.

Returns:
  CSIBCRotMatd& Reference to this matrix

See also:
  CSIBCRotMatd::Negate( const CSIBCRotMatd& )

Reimplemented from CSIBCMatrix33d.

double GetDet | ( | void |  | ) | const

Computes the determinant of this matrix.

Returns:
  double The determinant of this matrix.

See also:
  CSIBCRotMatd::GetTrace

  CSIBCRotMatd::IsSingular

Reimplemented from CSIBCMatrix33d.

double GetTrace | ( | void |  | ) | const

Computes the trace of this matrix. A trace is the sum of all the diagonal elements of a matrix.

Returns:
  double The trace of this matrix.

See also:
  CSIBCRotMatd::GetDet

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Transpose | ( | const CSIBCRotMatd & | in_mat | ) |

Sets this matrix to be the transpose of `in_mat`.

Parameters:

  | in_mat | Matrix containing the transpose of the desired matrix.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Transpose()

  CSIBCRotMatd::TransposeInverse

  CSIBCRotMatd::IsSymmetric

CSIBCRotMatd& Transpose | ( | void |  | ) |

Sets this matrix to its transpose.

Returns:
  CSIBCRotMatd& Reference to this matrix.

See also:
  CSIBCRotMatd::Transpose( const CSIBCRotMatd& )

  CSIBCRotMatd::TransposeInverse

Reimplemented from CSIBCMatrix33d.

CSIBCRotMatd& Invert | ( | const CSIBCRotMatd & | in_mat | ) |

Sets this matrix to be the inverse of `in_mat`.

Parameters:

  | in_mat | Matrix containing the inverse of the desired matrix.

Returns:
  bool true if `in_mat` could be inverted and the assignment was successful, false otherwise.

See also:
  CSIBCRotMatd::Invert()

  CSIBCRotMatd::TransposeInverse

CSIBCRotMatd& Invert | ( | void |  | ) |

Sets this matrix to its inverse.

Returns:
  bool true if this matrix could be inverted and the assignment was successful, false otherwise.

See also:
  CSIBCRotMatd::Invert( const CSIBCRotMatd& )

  CSIBCRotMatd::TransposeInverse

Reimplemented from CSIBCMatrix33d.

## Friends And Related Function Documentation

bool AreAlmostEqual | ( | const CSIBCRotMatd & | in_mat1,
|  | const CSIBCRotMatd & | in_mat2,
|  | const double | in_dEpsilon = `PICO_EPS` |
| ) |  |  | `[friend]`

Determines whether all corresponding elements of the matricies `in_mat1` and `in_mat2` are equal. Since this method uses floating-point comparison, a threshhold value of `in_dEpsilon` is used for equality comparison.

Parameters:

  | in_mat1 | First matrix for equality comparison.
  | in_mat2 | Second matrix for equality comparison.
  | in_dEpsilon | Floating-point comparison error range. Defaults to PICO_EPS.

Returns:
  bool true if the matricies are equal, false otherwise.

See also:
  CSIBCMatrix33d::operator==

  CSIBCMatrix33d::operator!=

The documentation for this class was generated from the following file:

- SIBCRotMatd.h