chrono::ChMatrix33< Real > Class Template Reference

Description

template<class Real = double>
class chrono::ChMatrix33< Real >

ChMatrix33.

A special type of NxM matrix: the 3x3 matrix that is commonly used to represent coordinate transformations in 3D space. This matrix cannot be resized. The 3x3 matrix can be multiplied/added with other matrix types.

Further info at the Rotation matrices manual page.

#include <ChMatrix33.h>

Inheritance diagram for chrono::ChMatrix33< Real >:
Collaboration diagram for chrono::ChMatrix33< Real >:

Public Member Functions

 ChMatrix33 ()
 Default constructor builds a 3x3 matrix with zeroes.
 
 ChMatrix33 (const ChMatrix33< Real > &msource)
 Copy constructor.
 
template<class RealB >
 ChMatrix33 (const ChMatrix< RealB > &msource)
 Copy constructor from all types of base matrices (only with same size)
 
 ChMatrix33 (Real val)
 Construct a diagonal 3x3 matrix with all diagonal elements equal to the specified value.
 
template<class RealB >
 ChMatrix33 (const ChVector< RealB > &vec)
 Construct a 3x3 matrix with the specified vector as its diagonal.
 
template<class RealB >
 ChMatrix33 (const ChVector< RealB > &diag, const ChVector<> &off_diag)
 Construct a symmetric 3x3 matrix with the specified vectors for the diagonal and off-diagonal. More...
 
template<class RealB >
 ChMatrix33 (const ChQuaternion< RealB > &mq)
 The constructor which builds a 3x3 matrix given a quaternion representing rotation.
 
template<class RealB >
 ChMatrix33 (const Real angle, const ChVector< RealB > &axis)
 Constructor that builds a rotation matrix from an agle of rotation and an axis, defined in absolute coords. More...
 
template<class RealB >
 ChMatrix33 (const RealB &m00, const RealB &m01, const RealB &m02, const RealB &m10, const RealB &m11, const RealB &m12, const RealB &m20, const RealB &m21, const RealB &m22)
 Complete generic constructor from 9 elements, ordered as three in first row, three in second row, three in third row. More...
 
ChMatrix33< Real > & operator= (const ChMatrix< Real > &matbis)
 Assignment operator (from generic other matrix, acceptable only if other matrix has 3x3 size)
 
ChMatrix33< Real > operator- () const
 Negates sign of the matrix. More...
 
template<class RealB >
ChMatrix33< Real > operator+ (const ChMatrix< RealB > &matbis) const
 Sums this matrix and another matrix (of same size) Performance warning: a new object is created. More...
 
template<class RealB >
ChMatrix33< Real > operator- (const ChMatrix< RealB > &matbis) const
 Subtracts this matrix and another matrix (of same size). More...
 
template<class RealB >
ChMatrix33< Real > operator* (const ChMatrix33< RealB > &matbis) const
 Multiplies this ChMatrix33 matrix and another ChMatrix33 matrix. More...
 
template<class RealB , int B_rows, int B_columns>
ChMatrixNM< Real, 3, B_columns > operator* (const ChMatrixNM< RealB, 3, B_columns > &matbis) const
 Multiplies this matrix and another ChMatrixNM matrix (3xN). More...
 
template<class RealB >
ChMatrixDynamic< Real > operator* (const ChMatrix< RealB > &matbis) const
 Multiplies this matrix and another generic matrix. More...
 
ChMatrix33< Real > operator* (const Real factor) const
 Multiplies this matrix by a scalar value Performance warning: a new object is created. More...
 
ChVector< Real > operator* (const ChVector< Real > &myvect) const
 Multiplies this matrix by a vector.
 
void Set33Identity ()
 Reset to identity a 3x3 matrix (ones on diagonal, zero elsewhere) Note: optimized, for 3x3 matrices ONLY!
 
bool IsIdentity () const
 Return true if this matrix is the identity 3x3 matrix.
 
template<class RealB >
ChVector< Real > Matr_x_Vect (const ChVector< RealB > &va) const
 Multiplies this matrix by a vector, like in coordinate rotation [M]*v. More...
 
template<class RealB >
ChVector< Real > MatrT_x_Vect (const ChVector< RealB > &va) const
 Multiplies this matrix (transposed) by a vector, as [M]'*v. More...
 
template<class RealB >
Real FastInvert (ChMatrix33< RealB > &matra)
 Fast inversion of small matrices. More...
 
void FastEigen (ChMatrix33< Real > &v, Real d[])
 Returns 3 eigenvalues and 3 eigenvectors in a 3x3 matrix, Notes: More...
 
template<class RealB >
void Set_A_quaternion (const ChQuaternion< RealB > &quat)
 Fills a 3x3 matrix as a rotation matrix corresponding to the rotation expressed by the quaternion 'quat'. More...
 
template<class RealB >
void Set_X_matrix (const ChVector< RealB > &vect)
 Fills a 3x3 matrix as the "star" matrix, representing vector cross product. More...
 
template<class RealB >
void Set_XY_matrix (const ChVector< RealB > &vectA, const ChVector< RealB > &vectB)
 Fills a 3x3 matrix as product of two 'cross product' matrices, as double vector cross product. More...
 
template<class RealB >
void Set_A_axis (const ChVector< RealB > &X, const ChVector< RealB > &Y, const ChVector< RealB > &Z)
 Fills a 3x3 matrix as a rotation matrix, given the three versors X,Y,Z of the basis. More...
 
template<class RealB >
void Set_A_Eulero (const ChVector< RealB > &eul)
 Fills a 3x3 matrix as a rotation matrix, given the three Eulero angles (not to be confused with 'Eulero parameters', aka quaternions)
 
template<class RealB >
void Set_A_Cardano (const ChVector< RealB > &car)
 Fills a 3x3 matrix as a rotation matrix, given the three Cardano angles. More...
 
template<class RealB >
void Set_A_Hpb (const ChVector< RealB > &hpb)
 Fills a 3x3 matrix as a rotation matrix, given the three head, pitch, banking angles. More...
 
template<class RealB >
void Set_A_Rxyz (const ChVector< RealB > &xyz)
 Fills a 3x3 matrix as a rotation matrix, given the three angles of consecutive rotations about x,y,z axis. More...
 
template<class RealB >
void Set_A_Rodriguez (const ChVector< RealB > &rod)
 Fills a 3x3 matrix as a rotation matrix, given the three Rodriguez' parameters. More...
 
void Set_A_Xdir (const ChVector< Real > &Xdir, const ChVector< Real > &Vsingular=ChVector< Real >(0, 1, 0))
 Use the Gram-Schmidt orthonormalization to find the three orthogonal vectors of a coordinate system whose X axis is this vector. More...
 
void Set_A_AngAxis (const Real angle, const ChVector< Real > &axis)
 Sets the rotation matrix from an agle of rotation and an axis, defined in absolute coords. More...
 
ChQuaternion< Real > Get_A_quaternion () const
 Given a 3x3 rotation matrix, computes the corresponding quaternion. More...
 
ChVector< Real > Get_A_Xaxis () const
 Given a 3x3 rotation matrix, returns the versor of X axis.
 
ChVector< Real > Get_A_Yaxis () const
 Given a 3x3 rotation matrix, returns the versor of Y axis.
 
ChVector< Real > Get_A_Zaxis () const
 Given a 3x3 rotation matrix, returns the versor of Z axis.
 
ChVector< Real > Get_A_Eulero () const
 Given a 3x3 rotation matrix, returns the Eulero angles.
 
ChVector< Real > Get_A_Cardano () const
 Given a 3x3 rotation matrix, returns the Cardano angles.
 
ChVector< Real > Get_A_Hpb () const
 Given a 3x3 rotation matrix, returns the head-pitch-banking angles.
 
ChVector< Real > Get_A_Rxyz () const
 Given a 3x3 rotation matrix, returns the angles for consecutive rotations on x,y,z axes. More...
 
ChVector< Real > Get_A_Rodriguez () const
 Given a 3x3 rotation matrix, returns the Rodriguez parameters.
 
ChMatrix33< Real > Get_Abs_Matrix () const
 Returns the absolute value of each element in the matrix.
 
ChVector< Real > Get_Diag () const
 Given a 3x3 rotation matrix, get the diagonal.
 
Real GetTrace () const
 Return the sum of the three elements on the diagonal.
 
ChVector< Real > GetAx () const
 Assuming it is an orthogonal rotation matrix, get Ax vector.
 
ChMatrix33< Real > GetSymm () const
 Return a symmetric matrix =(1/2)*(A+A')
 
void To_Marray (double marr[3][3])
 Convert to a 2-dimensional array.
 
ChMatrix33< Real > From_Marray (double marr[3][3])
 Convert from a 2-dimensional array.
 
- Public Member Functions inherited from chrono::ChMatrixNM< Real, 3, 3 >
 ChMatrixNM ()
 The default constructor builds a NxN matrix.
 
 ChMatrixNM (const ChMatrixNM< Real, preall_rows, preall_columns > &msource)
 Copy constructor.
 
 ChMatrixNM (const ChMatrix< RealB > &msource)
 Copy constructor from all types of base matrices (only with same size)
 
virtual ~ChMatrixNM ()
 Destructor.
 
ChMatrixNM< Real, preall_rows,
preall_columns > & 
operator= (const ChMatrix< Real > &matbis)
 Assignment operator (from generic other matrix, acceptable only if other matrix has same size)
 
ChMatrixNM< Real, preall_rows,
preall_columns > 
operator- () const
 Negates sign of the matrix. More...
 
ChMatrixNM< Real, preall_rows,
preall_columns > 
operator- (const ChMatrix< RealB > &matbis) const
 Subtracts this matrix and another matrix (of same size). More...
 
ChMatrixNM< Real, preall_rows,
preall_columns > 
operator+ (const ChMatrix< RealB > &matbis) const
 Sums this matrix and another matrix (of same size) Performance warning: a new object is created. More...
 
ChMatrixNM< Real, preall_rows,
B_columns > 
operator* (const ChMatrixNM< RealB, preall_columns, B_columns > &matbis) const
 Multiplies this matrix and another ChMatrixNM matrix. More...
 
ChMatrixDynamic< Real > operator* (const ChMatrix< RealB > &matbis) const
 Multiplies this matrix and another generic matrix. More...
 
ChMatrixNM< Real, preall_rows,
preall_columns > 
operator* (const Real factor) const
 Multiplies this matrix by a scalar value Performance warning: a new object is created. More...
 
virtual void Resize (int nrows, int ncols)
 Resize for this matrix is NOT SUPPORTED ! DO NOTHING!
 
- Public Member Functions inherited from chrono::ChMatrix< Real >
Real & operator() (const int row, const int col)
 Parenthesis () operator, to access a single element of the matrix, by supplying the row and the column (indexes start from 0). More...
 
const Real & operator() (const int row, const int col) const
 
Real & operator() (const int el)
 Parenthesis () operator, to access a single element of the matrix, by supplying the ordinal of the element (indexes start from 0). More...
 
const Real & operator() (const int el) const
 
Real * operator[] (const int row)
 The [] operator returns the address of the n-th row. More...
 
const Real * operator[] (const int row) const
 
ChMatrix< Real > & operator*= (const Real factor)
 Multiplies this matrix by a factor, in place.
 
template<class RealB >
ChMatrix< Real > & operator+= (const ChMatrix< RealB > &matbis)
 Increments this matrix by another matrix, in place.
 
template<class RealB >
ChMatrix< Real > & operator-= (const ChMatrix< RealB > &matbis)
 Decrements this matrix by another matrix, in place.
 
bool operator== (const ChMatrix< Real > &other)
 Matrices are equal?
 
bool operator!= (const ChMatrix< Real > &other)
 Matrices are not equal?
 
ChMatrix< Real > & operator= (const ChMatrix< Real > &matbis)
 Assignment operator.
 
template<class RealB >
ChMatrix< Real > & operator= (const ChMatrix< RealB > &matbis)
 
void SetElement (int row, int col, Real elem)
 Sets the element at row,col position. Indexes start with zero.
 
Real GetElement (int row, int col)
 Gets the element at row,col position. More...
 
Real GetElement (int row, int col) const
 
void SetElementN (int index, Real elem)
 Sets the Nth element, counting row after row.
 
Real GetElementN (int index)
 Gets the Nth element, counting row after row.
 
const Real GetElementN (int index) const
 
Real & Element (int row, int col)
 Access a single element of the matrix, by supplying the row and the column (indexes start from 0). More...
 
const Real & Element (int row, int col) const
 
Real & ElementN (int index)
 Access a single element of the matrix, the Nth element, counting row after row. More...
 
const Real & ElementN (int index) const
 
Real * GetAddress ()
 Access directly the "Real* address" buffer. More...
 
const Real * GetAddress () const
 
int GetRows () const
 Gets the number of rows.
 
int GetColumns () const
 Gets the number of columns.
 
void SwapColumns (int a, int b)
 Swaps the columns a and b.
 
void SwapRows (int a, int b)
 Swap the rows a and b.
 
void FillDiag (Real sample)
 Fill the diagonal elements, given a sample. More...
 
void FillElem (Real sample)
 Fill the matrix with the same value in all elements.
 
void FillRandom (Real max, Real min)
 Fill the matrix with random float numbers, falling within the "max"/"min" range. More...
 
void Reset ()
 Resets the matrix to zero (warning: simply sets memory to 0 bytes!)
 
void Reset (int nrows, int ncols)
 Reset to zeroes and (if needed) changes the size to have row and col.
 
void SetIdentity ()
 Reset to identity matrix (ones on diagonal, zero elsewhere)
 
template<class RealB >
void CopyFromMatrix (const ChMatrix< RealB > &matra)
 Copy a matrix "matra" into this matrix. More...
 
template<class RealB >
void CopyFromMatrixT (const ChMatrix< RealB > &matra)
 Copy the transpose of matrix "matra" into this matrix. More...
 
template<class RealB >
void CopyTUpMatrix (const ChMatrix< RealB > &matra)
 Copy the transposed upper triangular part of "matra" in the lower triangular part of this matrix. More...
 
template<class RealB >
void CopyTLwMatrix (const ChMatrix< RealB > &matra)
 Copy the transposed lower triangulat part of "matra" in the upper triangular part of this matrix. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data in archives.
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de serialization of transient data from archives.
 
void StreamOUT (ChStreamOutAscii &mstream)
 Method to allow serializing transient data into in ascii as a readable item, for example "chrono::GetLog() << myobject;" ***OBSOLETE***.
 
void StreamOUTdenseMatlabFormat (ChStreamOutAscii &mstream)
 Method to allow serializing transient data into an ascii stream (ex. More...
 
void MatrNeg ()
 Changes the sign of all the elements of this matrix, in place.
 
template<class RealB , class RealC >
void MatrAdd (const ChMatrix< RealB > &matra, const ChMatrix< RealC > &matrb)
 Sum two matrices, and stores the result in "this" matrix: [this]=[A]+[B].
 
template<class RealB , class RealC >
void MatrSub (const ChMatrix< RealB > &matra, const ChMatrix< RealC > &matrb)
 Subtract two matrices, and stores the result in "this" matrix: [this]=[A]-[B].
 
template<class RealB >
void MatrInc (const ChMatrix< RealB > &matra)
 Increments this matrix with another matrix A, as: [this]+=[A].
 
template<class RealB >
void MatrDec (const ChMatrix< RealB > &matra)
 Decrements this matrix with another matrix A, as: [this]-=[A].
 
void MatrScale (Real factor)
 Scales a matrix, multiplying all elements by a constant value: [this]*=f.
 
template<class RealB >
void MatrScale (const ChMatrix< RealB > &matra)
 Scales a matrix, multiplying all element by all oter elements of matra (it is not the classical matrix multiplication!)
 
void MatrDivScale (Real factor)
 Scales a matrix, dividing all elements by a constant value: [this]/=f.
 
template<class RealB >
void MatrDivScale (const ChMatrix< RealB > &matra)
 Scales a matrix, dividing all element by all oter elements of matra (it is not the classical matrix multiplication!)
 
template<class RealB , class RealC >
void MatrMultiply (const ChMatrix< RealB > &matra, const ChMatrix< RealC > &matrb)
 Multiplies two matrices, and stores the result in "this" matrix: [this]=[A]*[B].
 
template<class RealB , class RealC >
void MatrMultiplyT (const ChMatrix< RealB > &matra, const ChMatrix< RealC > &matrb)
 Multiplies two matrices (the second is considered transposed): [this]=[A]*[B]' Faster than doing B.MatrTranspose(); result.MatrMultiply(A,B); Note: no check on mistaken size of this!
 
template<class RealB , class RealC >
void MatrTMultiply (const ChMatrix< RealB > &matra, const ChMatrix< RealC > &matrb)
 Multiplies two matrices (the first is considered transposed): [this]=[A]'*[B] Faster than doing A.MatrTranspose(); result.MatrMultiply(A,B);.
 
void MatrTranspose ()
 Transpose this matrix in place.
 
Real Det ()
 Returns the determinant of the matrix. More...
 
void MatrInverse ()
 Returns the inverse of the matrix. More...
 
bool Equals (const ChMatrix< Real > &other)
 Returns true if vector is identical to other matrix.
 
bool Equals (const ChMatrix< Real > &other, Real tol)
 Returns true if vector equals another vector, within a tolerance 'tol'.
 
template<class RealB >
ChVector< Real > Matr34_x_Quat (const ChQuaternion< RealB > &qua)
 Multiplies this 3x4 matrix by a quaternion, as v=[G]*q The matrix must be 3x4. More...
 
template<class RealB >
ChQuaternion< Real > Matr34T_x_Vect (const ChVector< RealB > &va)
 Multiplies this 3x4 matrix (transposed) by a vector, as q=[G]'*v The matrix must be 3x4. More...
 
template<class RealB >
ChQuaternion< Real > Matr44_x_Quat (const ChQuaternion< RealB > &qua)
 Multiplies this 4x4 matrix (transposed) by a quaternion, The matrix must be 4x4. More...
 
void MatrXq_SemiTranspose ()
 Transposes only the lower-right 3x3 submatrix of a hemisimetric 4x4 matrix, used when the 4x4 matrix is a "star" matrix [q] coming from a quaternion q: the non commutative quat. More...
 
void MatrXq_SemiNeg ()
 Change the sign of the 2nd, 3rd and 4th columns of a 4x4 matrix, The product between a quaternion q1 and the coniugate of q2 (q2'), is: q1 x q2' = [q1]*q2' = [q1sn]*q2 where [q1sn] is the seminegation of the 4x4 matrix [q1]. More...
 
Real NormInf ()
 Gets the norm infinite of the matrix, i.e. More...
 
Real NormTwo ()
 Gets the norm two of the matrix, i.e. More...
 
Real Max ()
 Finds max value among the values of the matrix.
 
Real Min ()
 Finds min value among the values of the matrix.
 
void LinInterpolate (const ChMatrix< Real > &matra, const ChMatrix< Real > &matrb, Real mx)
 Linear interpolation of two matrices. More...
 
void RowColInterp (Real vmin, Real vmax, Real umin, Real umax)
 Fills a matrix or a vector with a bilinear interpolation, from corner values (as a u-v patch). More...
 
template<class RealB >
void PasteMatrix (const ChMatrix< RealB > &matra, int insrow, int inscol)
 Paste a matrix "matra" into "this", inserting at location insrow-inscol. More...
 
template<class RealB >
void PasteSumMatrix (const ChMatrix< RealB > &matra, int insrow, int inscol)
 Paste a matrix "matra" into "this", inserting at location insrow-inscol and performing a sum with the preexisting values. More...
 
template<class RealB >
void PasteTranspMatrix (const ChMatrix< RealB > &matra, int insrow, int inscol)
 Paste a matrix "matra", transposed, into "this", inserting at location insrow-inscol. More...
 
template<class RealB >
void PasteSumTranspMatrix (const ChMatrix< RealB > &matra, int insrow, int inscol)
 Paste a matrix "matra", transposed, into "this", inserting at location insrow-inscol and performing a sum with the preexisting values. More...
 
template<class RealB >
void PasteClippedMatrix (const ChMatrix< RealB > &matra, int cliprow, int clipcol, int nrows, int ncolumns, int insrow, int inscol)
 Paste a clipped portion of the matrix "matra" into "this", inserting the clip (of size nrows, ncolumns) at the location insrow-inscol. More...
 
template<class RealB >
void PasteClippedMatrixToVector (const ChMatrix< RealB > &matra, int cliprow, int clipcol, int nrows, int ncolumns, int insindex)
 Paste a clipped portion of the matrix "matra" into "this", where "this" is a vector (of ChMatrix type), inserting the clip (of size nrows, ncolumns) at the location insindex. More...
 
template<class RealB >
void PasteClippedVectorToMatrix (const ChMatrix< RealB > &matra, int cliprow, int clipcol, int nrows, int ncolumns, int insindex)
 Paste a clipped portion of a vector into "this", where "this" is a matrix (of ChMatrix type), inserting the clip (of size nrows, ncolumns) at the location insindex. More...
 
template<class RealB >
void PasteSumClippedMatrix (const ChMatrix< RealB > &matra, int cliprow, int clipcol, int nrows, int ncolumns, int insrow, int inscol)
 Paste a clipped portion of the matrix "matra" into "this", performing a sum with preexisting values, inserting the clip (of size nrows, ncolumns) at the location insrow-inscol. More...
 
template<class RealB >
void PasteVector (const ChVector< RealB > &va, int insrow, int inscol)
 Paste a vector "va" into the matrix.
 
template<class RealB >
void PasteSumVector (const ChVector< RealB > &va, int insrow, int inscol)
 Paste a vector "va" into the matrix, summing it with preexisting values.
 
template<class RealB >
void PasteSubVector (const ChVector< RealB > &va, int insrow, int inscol)
 Paste a vector "va" into the matrix, subtracting it from preexisting values.
 
template<class RealB >
void PasteQuaternion (const ChQuaternion< RealB > &qa, int insrow, int inscol)
 Paste a quaternion into the matrix.
 
template<class RealB >
void PasteSumQuaternion (const ChQuaternion< RealB > &qa, int insrow, int inscol)
 Paste a quaternion into the matrix, summing it with preexisting values.
 
template<class RealB >
void PasteCoordsys (const ChCoordsys< RealB > &cs, int insrow, int inscol)
 Paste a coordsys into the matrix.
 
ChVector< Real > ClipVector (int insrow, int inscol) const
 Returns the vector clipped from insrow, inscol.
 
ChQuaternion< Real > ClipQuaternion (int insrow, int inscol) const
 Returns the quaternion clipped from insrow, inscol.
 
ChCoordsys< Real > ClipCoordsys (int insrow, int inscol) const
 Returns the coordsys clipped from insrow, inscol.
 
template<class RealB >
void Set_Xq_matrix (const ChQuaternion< RealB > &q)
 Fills a 4x4 matrix as the "star" matrix, representing quaternion cross product. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from chrono::ChMatrix< Real >
template<class RealB , class RealC >
static Real MatrDot (const ChMatrix< RealB > &ma, const ChMatrix< RealC > &mb)
 Computes dot product between two column-matrices (vectors) with same size. More...
 
- Protected Attributes inherited from chrono::ChMatrixNM< Real, 3, 3 >
Real buffer [preall_rows *preall_columns]
 
- Protected Attributes inherited from chrono::ChMatrix< Real >
int rows
 
int columns
 
Real * address
 

Constructor & Destructor Documentation

template<class Real = double>
template<class RealB >
chrono::ChMatrix33< Real >::ChMatrix33 ( const ChVector< RealB > &  diag,
const ChVector<> &  off_diag 
)

Construct a symmetric 3x3 matrix with the specified vectors for the diagonal and off-diagonal.

The off-diagonal vector is assumed to contain the elements A(0,1), A(0,2), A(1,2) in this order.

template<class Real = double>
template<class RealB >
chrono::ChMatrix33< Real >::ChMatrix33 ( const Real  angle,
const ChVector< RealB > &  axis 
)

Constructor that builds a rotation matrix from an agle of rotation and an axis, defined in absolute coords.

NOTE, axis must be normalized!

Parameters
angleangle of rotation, in radians
axisaxis of rotation, normalized
template<class Real = double>
template<class RealB >
chrono::ChMatrix33< Real >::ChMatrix33 ( const RealB &  m00,
const RealB &  m01,
const RealB &  m02,
const RealB &  m10,
const RealB &  m11,
const RealB &  m12,
const RealB &  m20,
const RealB &  m21,
const RealB &  m22 
)

Complete generic constructor from 9 elements, ordered as three in first row, three in second row, three in third row.

Member Function Documentation

template<class Real = double>
void chrono::ChMatrix33< Real >::FastEigen ( ChMatrix33< Real > &  v,
Real  d[] 
)

Returns 3 eigenvalues and 3 eigenvectors in a 3x3 matrix, Notes:

  • only for cases where eigenvalues 'd' are real!!
  • output eigenvectors as columns of matrix 'v'
  • this original matrix is modified
template<class Real = double>
template<class RealB >
Real chrono::ChMatrix33< Real >::FastInvert ( ChMatrix33< RealB > &  matra)

Fast inversion of small matrices.

Result will be in 'matra'.

Returns
Returns the determinant.
template<class Real = double>
ChQuaternion<Real> chrono::ChMatrix33< Real >::Get_A_quaternion ( ) const

Given a 3x3 rotation matrix, computes the corresponding quaternion.

template<class Real = double>
ChVector<Real> chrono::ChMatrix33< Real >::Get_A_Rxyz ( ) const

Given a 3x3 rotation matrix, returns the angles for consecutive rotations on x,y,z axes.

template<class Real = double>
template<class RealB >
ChVector<Real> chrono::ChMatrix33< Real >::Matr_x_Vect ( const ChVector< RealB > &  va) const

Multiplies this matrix by a vector, like in coordinate rotation [M]*v.

Returns
The result of the multiplication, i.e. a vector.
template<class Real = double>
template<class RealB >
ChVector<Real> chrono::ChMatrix33< Real >::MatrT_x_Vect ( const ChVector< RealB > &  va) const

Multiplies this matrix (transposed) by a vector, as [M]'*v.

Returns
The result of the multiplication, i.e. a vector.
template<class Real = double>
template<class RealB >
ChMatrix33<Real> chrono::ChMatrix33< Real >::operator* ( const ChMatrix33< RealB > &  matbis) const

Multiplies this ChMatrix33 matrix and another ChMatrix33 matrix.

Performance warning: a new object is created.

template<class Real = double>
template<class RealB , int B_rows, int B_columns>
ChMatrixNM<Real, 3, B_columns> chrono::ChMatrix33< Real >::operator* ( const ChMatrixNM< RealB, 3, B_columns > &  matbis) const

Multiplies this matrix and another ChMatrixNM matrix (3xN).

Performance warning: a new object is created (of ChMatrixNM type).

template<class Real = double>
template<class RealB >
ChMatrixDynamic<Real> chrono::ChMatrix33< Real >::operator* ( const ChMatrix< RealB > &  matbis) const

Multiplies this matrix and another generic matrix.

Performance warning: a new object is created (of ChMatrixDynamic type).

template<class Real = double>
ChMatrix33<Real> chrono::ChMatrix33< Real >::operator* ( const Real  factor) const

Multiplies this matrix by a scalar value Performance warning: a new object is created.

template<class Real = double>
template<class RealB >
ChMatrix33<Real> chrono::ChMatrix33< Real >::operator+ ( const ChMatrix< RealB > &  matbis) const

Sums this matrix and another matrix (of same size) Performance warning: a new object is created.

template<class Real = double>
ChMatrix33<Real> chrono::ChMatrix33< Real >::operator- ( ) const

Negates sign of the matrix.

Performance warning: a new object is created.

template<class Real = double>
template<class RealB >
ChMatrix33<Real> chrono::ChMatrix33< Real >::operator- ( const ChMatrix< RealB > &  matbis) const

Subtracts this matrix and another matrix (of same size).

Performance warning: a new object is created.

template<class Real = double>
void chrono::ChMatrix33< Real >::Set_A_AngAxis ( const Real  angle,
const ChVector< Real > &  axis 
)

Sets the rotation matrix from an agle of rotation and an axis, defined in absolute coords.

NOTE, axis must be normalized!

Parameters
angleangle of rotation, in radians
axisaxis of rotation, normalized
template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_A_axis ( const ChVector< RealB > &  X,
const ChVector< RealB > &  Y,
const ChVector< RealB > &  Z 
)

Fills a 3x3 matrix as a rotation matrix, given the three versors X,Y,Z of the basis.

template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_A_Cardano ( const ChVector< RealB > &  car)

Fills a 3x3 matrix as a rotation matrix, given the three Cardano angles.

template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_A_Hpb ( const ChVector< RealB > &  hpb)

Fills a 3x3 matrix as a rotation matrix, given the three head, pitch, banking angles.

template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_A_quaternion ( const ChQuaternion< RealB > &  quat)

Fills a 3x3 matrix as a rotation matrix corresponding to the rotation expressed by the quaternion 'quat'.

template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_A_Rodriguez ( const ChVector< RealB > &  rod)

Fills a 3x3 matrix as a rotation matrix, given the three Rodriguez' parameters.

template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_A_Rxyz ( const ChVector< RealB > &  xyz)

Fills a 3x3 matrix as a rotation matrix, given the three angles of consecutive rotations about x,y,z axis.

template<class Real = double>
void chrono::ChMatrix33< Real >::Set_A_Xdir ( const ChVector< Real > &  Xdir,
const ChVector< Real > &  Vsingular = ChVector<Real>(0, 1, 0) 
)

Use the Gram-Schmidt orthonormalization to find the three orthogonal vectors of a coordinate system whose X axis is this vector.

mVsingular (optional) suggests the XY plane, possibly it is not too parallel to X.

Parameters
XdirX axis
Vsingulara direction on XY plane (optional suggestion for Y axis)
template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_X_matrix ( const ChVector< RealB > &  vect)

Fills a 3x3 matrix as the "star" matrix, representing vector cross product.

That is, given two 3d vectors a and b, aXb= [Astar]*b

template<class Real = double>
template<class RealB >
void chrono::ChMatrix33< Real >::Set_XY_matrix ( const ChVector< RealB > &  vectA,
const ChVector< RealB > &  vectB 
)

Fills a 3x3 matrix as product of two 'cross product' matrices, as double vector cross product.