Simbody  3.6
SimTK::InverseRotation_< P > Class Template Reference

(Advanced) This InverseRotation class is the inverse of a Rotation. More...

Public Types

typedef Mat< 3, 3, P >::TransposeType BaseMat
 This is the type of the underlying 3x3 matrix; note that it will have unusual row and column spacing since we're viewing it as transposed. More...
 
typedef UnitVec< P, BaseMat::RowSpacing > ColType
 Note that the unit vectors representing the rows and columns of this matrix do not necessarily have unit stride. More...
 
typedef UnitRow< P, BaseMat::ColSpacing > RowType
 This is the type of a row of this InverseRotation. More...
 

Public Member Functions

 InverseRotation_ ()
 You should not ever construct one of these as they should only occur as expression intermediates resulting from use of the "~" operator on a Rotation. More...
 
 InverseRotation_ (const InverseRotation_ &R)
 An explicit implementation of the default copy constructor. More...
 
InverseRotation_operator= (const InverseRotation_ &R)
 An explicit implementation of the default copy assignment operator. More...
 
SymMat< 3, P > reexpressSymMat33 (const SymMat< 3, P > &S_BB) const
 Assuming this InverseRotation_ is R_AB, and given a symmetric dyadic matrix S_BB expressed in B, we can reexpress it in A using S_AA=R_AB*S_BB*R_BA. More...
 
const Rotation_< P > & invert () const
 We can invert an InverseRotation just by recasting it to a Rotation at zero cost. More...
 
Rotation_< P > & updInvert ()
 
const Rotation_< P > & transpose () const
 Transpose, and transpose operators (override BaseMat versions of transpose). More...
 
const Rotation_< P > & operator~ () const
 
Rotation_< P > & updTranspose ()
 
Rotation_< P > & operator~ ()
 
const RowTyperow (int i) const
 Access individual rows and columns of this InverseRotation; no cost or copying since suitably-cast references to the actual data are returned. More...
 
const RowTypeoperator[] (int i) const
 
const ColTypecol (int j) const
 
const ColTypeoperator() (int j) const
 
const ColTypex () const
 
const ColTypey () const
 
const ColTypez () const
 
const ColTypegetAxisUnitVec (CoordinateAxis axis) const
 Given a CoordinateAxis (XAxis,YAxis, or ZAxis) return a reference to the corresponding column of this InverseRotation matrix. More...
 
const UnitVec< P, 1 > getAxisUnitVec (CoordinateDirection dir) const
 Given a CoordinateDirection (+/-XAxis, etc.) return a unit vector in that direction. More...
 
const BaseMatasMat33 () const
 Conversion from InverseRotation_ to BaseMat. More...
 
BaseMat toMat33 () const
 

Detailed Description

template<class P>
class SimTK::InverseRotation_< P >

(Advanced) This InverseRotation class is the inverse of a Rotation.

See the Rotation class for more information.

Member Typedef Documentation

◆ BaseMat

template<class P >
typedef Mat<3,3,P>::TransposeType SimTK::InverseRotation_< P >::BaseMat

This is the type of the underlying 3x3 matrix; note that it will have unusual row and column spacing since we're viewing it as transposed.

◆ ColType

template<class P >
typedef UnitVec<P,BaseMat::RowSpacing> SimTK::InverseRotation_< P >::ColType

Note that the unit vectors representing the rows and columns of this matrix do not necessarily have unit stride.

This is the type of a column of this InverseRotation.

◆ RowType

template<class P >
typedef UnitRow<P,BaseMat::ColSpacing> SimTK::InverseRotation_< P >::RowType

This is the type of a row of this InverseRotation.

Constructor & Destructor Documentation

◆ InverseRotation_() [1/2]

template<class P >
SimTK::InverseRotation_< P >::InverseRotation_ ( )
inline

You should not ever construct one of these as they should only occur as expression intermediates resulting from use of the "~" operator on a Rotation.

But if you must, the default will produce an identity rotation.

◆ InverseRotation_() [2/2]

template<class P >
SimTK::InverseRotation_< P >::InverseRotation_ ( const InverseRotation_< P > &  R)
inline

An explicit implementation of the default copy constructor.

Member Function Documentation

◆ operator=()

template<class P >
InverseRotation_& SimTK::InverseRotation_< P >::operator= ( const InverseRotation_< P > &  R)
inline

An explicit implementation of the default copy assignment operator.

◆ reexpressSymMat33()

template<class P >
SymMat<3,P> SimTK::InverseRotation_< P >::reexpressSymMat33 ( const SymMat< 3, P > &  S_BB) const

Assuming this InverseRotation_ is R_AB, and given a symmetric dyadic matrix S_BB expressed in B, we can reexpress it in A using S_AA=R_AB*S_BB*R_BA.

The matrix should be one that is formed as products of vectors expressed in A, such as inertia, unit inertia (gyration) or covariance matrices. This can be done efficiently exploiting properties of R and S. Cost is 57 flops.

See also
Rotation::reexpressSymMat33()

◆ invert()

template<class P >
const Rotation_<P>& SimTK::InverseRotation_< P >::invert ( ) const
inline

We can invert an InverseRotation just by recasting it to a Rotation at zero cost.

◆ updInvert()

template<class P >
Rotation_<P>& SimTK::InverseRotation_< P >::updInvert ( )
inline

◆ transpose()

template<class P >
const Rotation_<P>& SimTK::InverseRotation_< P >::transpose ( ) const
inline

Transpose, and transpose operators (override BaseMat versions of transpose).

For an orthogonal matrix like this one transpose is the same as inverse.

◆ operator~() [1/2]

template<class P >
const Rotation_<P>& SimTK::InverseRotation_< P >::operator~ ( ) const
inline

◆ updTranspose()

template<class P >
Rotation_<P>& SimTK::InverseRotation_< P >::updTranspose ( )
inline

◆ operator~() [2/2]

template<class P >
Rotation_<P>& SimTK::InverseRotation_< P >::operator~ ( )
inline

◆ row()

template<class P >
const RowType& SimTK::InverseRotation_< P >::row ( int  i) const
inline

Access individual rows and columns of this InverseRotation; no cost or copying since suitably-cast references to the actual data are returned.

There are no writable versions of these methods since changing a single row or column would violate the contract that these are always legitimate rotation matrices.

◆ operator[]()

template<class P >
const RowType& SimTK::InverseRotation_< P >::operator[] ( int  i) const
inline

◆ col()

template<class P >
const ColType& SimTK::InverseRotation_< P >::col ( int  j) const
inline

◆ operator()()

template<class P >
const ColType& SimTK::InverseRotation_< P >::operator() ( int  j) const
inline

◆ x()

template<class P >
const ColType& SimTK::InverseRotation_< P >::x ( ) const
inline

◆ y()

template<class P >
const ColType& SimTK::InverseRotation_< P >::y ( ) const
inline

◆ z()

template<class P >
const ColType& SimTK::InverseRotation_< P >::z ( ) const
inline

◆ getAxisUnitVec() [1/2]

template<class P >
const ColType& SimTK::InverseRotation_< P >::getAxisUnitVec ( CoordinateAxis  axis) const
inline

Given a CoordinateAxis (XAxis,YAxis, or ZAxis) return a reference to the corresponding column of this InverseRotation matrix.

The result is equivalent to multiplying R_AB*v_B where v_B is [1,0,0],[0,1,0], or [0,0,1], which would cost 15 flops, but requires no computation.

◆ getAxisUnitVec() [2/2]

template<class P >
const UnitVec<P,1> SimTK::InverseRotation_< P >::getAxisUnitVec ( CoordinateDirection  dir) const
inline

Given a CoordinateDirection (+/-XAxis, etc.) return a unit vector in that direction.

The result is equivalent to multiplying R_AB*v_B where v_B is [+/-1,0,0], [0,+/-1,0], or [0,0,+/-1], which would cost 15 flops, but this method requires at most 3 flops.

◆ asMat33()

template<class P >
const BaseMat& SimTK::InverseRotation_< P >::asMat33 ( ) const
inline

Conversion from InverseRotation_ to BaseMat.

Note: asMat33 is slightly more efficient than toMat33() (no copy), but you have to know the internal layout.

◆ toMat33()

template<class P >
BaseMat SimTK::InverseRotation_< P >::toMat33 ( ) const
inline

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