|
| SBDTypePhysicalMatrix33 () |
| Constructs a physical matrix with all components set to zero.
|
|
| SBDTypePhysicalMatrix33 (const SBDTypePhysicalVector3< Quantity > &d) |
| Constructs the diagonal physical matrix with diagonal [ d.v [0] d.v [1] d.v [2] ].
|
|
| SBDTypePhysicalMatrix33 (const SBDTypePhysicalVector3< Quantity > &c0, const SBDTypePhysicalVector3< Quantity > &c1, const SBDTypePhysicalVector3< Quantity > &c2) |
| Constructs the physical matrix with columns c0 , c1 and c2 .
|
|
| SBDTypePhysicalMatrix33 (const Quantity &v) |
| Constructs the physical matrix with all components set to v .
|
|
| SBDTypePhysicalMatrix33 (Quantity mat[3][3]) |
| Constructs the physical matrix from the quantity array mat .
|
|
| SBDTypePhysicalMatrix33 (const Quantity &m00, const Quantity &m01, const Quantity &m02, const Quantity &m10, const Quantity &m11, const Quantity &m12, const Quantity &m20, const Quantity &m21, const Quantity &m22) |
| Constructs the physical matrix from components m00 , m01 , m02 , m10 , m11 , m12 , m20 , m21 and m22 .
|
|
| SBDTypePhysicalMatrix33 (double d) |
| Constructs the dimensionless physical matrix with all components set to d .
|
|
| SBDTypePhysicalMatrix33 (double mat[3][3]) |
| Constructs the dimensionless physical matrix from double array mat .
|
|
| SBDTypePhysicalMatrix33 (double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) |
| Constructs the dimensionless physical matrix from components m00 , m01 , m02 , m10 , m11 , m12 , m20 , m21 and m22 .
|
|
|
Quantity | m [3][3] |
| The components of the physical matrix.
|
|
static const SBDTypePhysicalMatrix33< Quantity > | zero |
| The zero physical matrix.
|
|
static const SBDTypePhysicalMatrix33< Quantity > | identity |
| The identity physical matrix.
|
|
Quantity | trace () const |
| Returns the trace m[0][0] + m[1][1] + m[2][2] of this physical matrix.
|
|
void | print () const |
| Prints this physical matrix.
|
|
void | setIdentity () |
| Sets this physical matrix to the identity matrix.
|
|
void | setZero () |
| Sets this physical matrix to zero.
|
|
SBDTypePhysicalMatrix33< Quantity > | transpose () const |
| Returns the transpose of this physical matrix.
|
|
void | toQuaternion (SBQuantity::dimensionless &w, SBQuantity::dimensionless &x, SBQuantity::dimensionless &y, SBQuantity::dimensionless &z) const |
| Computes the quaternion [ w x y z ] corresponding to this physical matrix.
|
|
void | toRotationVector (SBVector3 &rotationVector) const |
| Computes the rotation vector corresponding to this dimensionless physical matrix.
|
|
void | orthonormalize () |
| Orthonormalizes this dimensionless physical matrix.
|
|
void | quasiStaticUpdate (const SBQuantity::dimensionless &wx, const SBQuantity::dimensionless &wy, const SBQuantity::dimensionless &wz, SBQuantity::dimensionless &rotAngle, SBVector3 &rotAxis, SBDTypePhysicalMatrix33< Quantity > &rotA, SBDTypePhysicalMatrix33< Quantity > &rotB, SBDTypePhysicalMatrix33< Quantity > &rotC) |
| Performs a quasi-static update of this dimensionless physical matrix using the rotation vector [ wx wy wz ]. More...
|
|
void | computeEulerDecompositionZYZ (SBQuantity::dimensionless &phi, SBQuantity::dimensionless &theta, SBQuantity::dimensionless &psi) |
| Computes a ZYZ Euler decomposition of this physical matrix. More...
|
|
void | revoluteJointZAxisMatrix (const SBVector3 &axis) |
| Sets this physical matrix to an orthonormal matrix whose third column is axis .
|
|
void | diagonalize (SBDTypePhysicalVector3< Quantity > &ev, SBDTypePhysicalMatrix33< SBQuantity::dimensionless > &p) |
| Computes the eigenvalues ev and the eigenvectors p of this physical matrix. More...
|
|
SBQuantityProduct3< Quantity, Quantity, Quantity >::Type | det () const |
| Returns the determinant of this physical matrix.
|
|
Quantity | norm () const |
| Returns the 2-norm of this physical matrix.
|
|
Quantity | cosphi () const |
| Returns the cosine of the rotation angle of this rotation matrix. More...
|
|
SBDTypePhysicalMatrix33< typename SBQuantityInverse< Quantity >::Type > | inverse () const |
| Returns the inverse of this physical matrix. More...
|
|
void | makeEulerRotationZYZ (const SBQuantity::dimensionless &phi, const SBQuantity::dimensionless &theta, const SBQuantity::dimensionless &psi) |
| This function sets this physical matrix from ZYZ Euler angles phi , theta and psi . More...
|
|
void | swapColumns (unsigned int i, unsigned int j) |
| Swaps columns i and j .
|
|
void | swapRows (unsigned int i, unsigned int j) |
| Swaps rows i and j .
|
|
static SBDTypePhysicalMatrix33< SBQuantity::dimensionless > | fromQuaternion (const SBQuantity::dimensionless &w, const SBQuantity::dimensionless &x, const SBQuantity::dimensionless &y, const SBQuantity::dimensionless &z) |
| Returns the dimensionless physical matrix corresponding to quaternion [ w x y z ].
|
|
static SBDTypePhysicalMatrix33< SBQuantity::dimensionless > | fromAxisAngle (const SBVector3 &axis, const SBQuantity::dimensionless &angle) |
| Returns the dimensionless physical matrix corresponding to rotation axis axis and rotation angle angle (in radians)
|
|
static SBDTypePhysicalMatrix33< SBQuantity::dimensionless > | fromAxisAnglePi (const SBVector3 &axis) |
| Returns the dimensionless physical matrix corresponding to rotation axis axis and a rotation angle equal to Pi.
|
|
static SBDTypePhysicalMatrix33< SBQuantity::dimensionless > | fromAlignment (const SBVector3 &from, const SBVector3 &to) |
| Returns the dimensionless physical matrix that transforms vector from into vector to . Precisely, left-multiplying vector from by the resulting matrix produces vector to .
|
|
template<typename Quantity>
class SBDTypePhysicalMatrix33< Quantity >
- Template Parameters
-
Quantity | The quantity type of the interval |
This template class describes 3x3 physical matrices.
Physical matrices are physical quantities, and thus use SAMSON's unit system. In a physical matrix (e.g. an inertia tensor), all components have the same unit, so that physical matrices are defined by only one unit, and the SBDTypePhysicalMatrix33 template class is parameterized by only one type: Quantity
.
Most of the time, developers of SAMSON Elements do not have to use this template, but may directly use some predefined types that correspond to specific instantiations of this template class, e.g. SBMatrix33 (dimensionless matrix), SBMass33 (mass matrix), SBInertiaTensor33 (inertia tensor), etc.
Dimensionless 3x3 matrices (SBMatrix33) are especially useful since they are used to represent 3D reference frames, rotation matrices, rigid-body transforms, etc.
Short name: SBPhysicalInterval
- See also
- SAMSON's unit system
-
The SBDType library
-
SBDTypePhysicalVector3
-
SBDTypeSpatialTransform
template<typename Quantity >
- Parameters
-
phi | The first Z rotation angle |
theta | The Y rotation angle |
psi | The second Z rotation angle |
This function computes a ZYZ Euler decomposition of this physical matrix:
\(\mathbf{M}=\mathbf{R}(z,psi)\mathbf{R}(y,theta)\mathbf{R}(z,phi)\)
where \(\mathbf{M}\) denotes this physical matrix, \(\mathbf{R}(z,phi)\) denotes the first rotation around the Z axis, \(\mathbf{R}(y,theta)\) denotes the rotation around the Y axis, and \(\mathbf{R}(z,psi)\) denotes the second rotation around the Z axis.
Note that this function may only be used with dimensionless physical matrices.
template<typename Quantity >
- Parameters
-
phi | The first Z rotation angle |
theta | The Y rotation angle |
psi | The second Z rotation angle |
This function sets this physical matrix from ZYZ Euler angles:
\(\mathbf{M}=\mathbf{R}(z,psi)\mathbf{R}(y,theta)\mathbf{R}(z,phi)\)
where \(\mathbf{M}\) denotes this physical matrix, \(\mathbf{R}(z,phi)\) denotes the first rotation around the Z axis, \(\mathbf{R}(y,theta)\) denotes the rotation around the Y axis, and \(\mathbf{R}(z,psi)\) denotes the second rotation around the Z axis.
Note that this function may only be used with dimensionless physical matrices.
template<typename Quantity >
- Parameters
-
wx | The first component of the rotation vector |
wy | The second component of the rotation vector |
wz | The third component of the rotation vector |
rotAngle | The rotation angle |
rotAxis | The rotation axis |
rotA | The rotation axis |
rotB | The rotation axis |
rotC | The rotation axis |
This function performs a quasi-static update of this dimensionless physical matrix using the rotation vector [ wx
wy
wz
]. During the update, The rotation vector [ wx
wy
wz
] is converted to a rotation angle and rotation axis, respectively stored into rotAngle
and rotAxis
. If \(\mathbf{M}\) denotes the original matrix, the final matrix is \(\cos(w)\mathbf{A}+\sin(w)\mathbf{B}+\mathbf{C}\), where \(\mathbf{A}\), \(\mathbf{B}\) and \(\mathbf{C}\) are physical matrices computed from \(\mathbf{M}\) and the rotation axis \(\mathbf{v}\), and \(w\) is the rotation angle:
- \(\mathbf{A}=(\mathbf{I}-\mathbf{v}\mathbf{v}^T)\mathbf{M}\)
- \(\mathbf{B}=\tilde{\mathbf{v}}\mathbf{M}\)
- \(\mathbf{C}=\mathbf{v}\mathbf{v}^T\mathbf{M}\)
where \(\tilde{\mathbf{v}}\) is the matrix such that \(\tilde{\mathbf{v}}\mathbf{x}=\mathbf{v}\times\mathbf{x}\) for any \(\mathbf{x}\).
When the function returns, \(\mathbf{A}\), \(\mathbf{B}\) and \(\mathbf{C}\) are stored into rotA
, rotB
and rotC
, respectively.
Note that this function may only be used with dimensionless physical matrices.