26 #include <Geometry/CoordinateTransform3D.hh>
27 #include <MathAlgo/SVD.hh>
28 #include <Base/Geometry/RMatrixBase.hh>
31 #include <Base/Math/Matrix3x4.hh>
40 invTransform_.SetIdentity();
49 for (
unsigned int row=0; row<3; row++) {
50 for (
unsigned int column=0; column<3; column++) {
52 (*this)[row][column] = R[column][row] / scale_;
55 invTransform_[column][row] = R[column][row] * scale_;
57 (*this)[row][3] = RTC[row] / scale_ * (-1.0);
58 invTransform_[row][3] = C_[row]*scale_;
66 invTransform_.SetIdentity();
68 for (
unsigned int row=0; row<3; row++) {
69 for (
unsigned int column=0; column<4; column++) {
70 (*this)[row][column] = M[row][column];
80 invTransform_ = svd.
Invert();
86 for (
unsigned int row=0; row<3; row++) {
87 for (
unsigned int column=0; column<4; column++) {
88 P[row][column] = (*this)[row][column];
102 Load(
const std::string& inputFile)
104 ifstream ifs(inputFile.c_str());
119 Save(
const std::string& outputFile)
121 ofstream ofs(outputFile.c_str());
154 res.
Set(Q_ * localT.
Q_,
172 cout<<
"Transformation RAW: "<<endl;
175 for(
unsigned int i=0; i < 4; i++){
176 for(
unsigned int j=0; j < 4; j++){
177 cout << (*this)[i][j] <<
" ";
185 cout<<
"Rotation Matrix: "<<R<<endl;
191 cout<<
" axis = "<<axis<<endl;
192 cout<<
"angle = "<<angle<<endl<<endl;
computes and holds the singular value decomposition of a rectangular (not necessarily quadratic) Matr...
int SetFromQuaternion(const Quaternion< ROTATION_MATRIX_TYPE > &q)
Set rotation matrix from a quaternion.
int MultVec(const Vector3< QUAT_TYPE > &vec, Vector3< QUAT_TYPE > &res) const
rotates the given Vector qith the quaternion ( q v q* ) the resulting vector is given in res ...
int GetQuaternion(Quaternion< ROTATION_MATRIX_TYPE > &quat) const
Calculates quaternion representation for this rotation matrix.
void Set(const int row, const int col, const Matrix< T > &data)
Copies the contents of data into this at the position indicated by row and col.
Matrix3x3< T > Transpose() const
returns transposed matrix tested 12.06.2002
Matrix< double > Invert()
returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T
Implements a 3D rotation matrix.
int GetRotationAxisAngle(Vector3< ROTATION_MATRIX_TYPE > &axis, ROTATION_MATRIX_TYPE &angle) const
Calculates angle and rotation axis representation for this rotation matrix.