23 #ifndef __RMatrixBase_hh__
24 #define __RMatrixBase_hh__
25 #include "bias_config.h"
27 #include <Base/Math/Vector3.hh>
28 #include <Base/Math/Matrix3x3.hh>
29 #include <Base/Debug/Debug.hh>
33 #define ROTATION_MATRIX_TYPE double
35 #define ROTATION_MATRIX_EPSILON DBL_EPSILON
37 template<
class T>
class BIASGeometryBase_EXPORT
Quaternion;
68 const ROTATION_MATRIX_TYPE phi);
97 void SetXYZ(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY,
98 ROTATION_MATRIX_TYPE PhiZ);
102 { SetXYZ(r[0], r[1], r[2]); }
125 void SetZYX(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY,
126 ROTATION_MATRIX_TYPE PhiZ);
130 { SetZYX(r[0], r[1], r[2]); }
153 void SetZXY(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY,
154 ROTATION_MATRIX_TYPE PhiZ);
158 { SetZXY(r[0], r[1], r[2]); }
175 void SetYXZ(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY,
176 ROTATION_MATRIX_TYPE PhiZ);
180 { SetYXZ(r[0], r[1], r[2]); }
189 void SetXZY(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY,
190 ROTATION_MATRIX_TYPE PhiZ);
194 { SetXZY(r[0], r[1], r[2]); }
204 void SetYZX(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY,
205 ROTATION_MATRIX_TYPE PhiZ);
209 { SetYZX(r[0], r[1], r[2]); }
217 const ROTATION_MATRIX_TYPE phi);
286 ROTATION_MATRIX_TYPE& angle)
const;
292 ROTATION_MATRIX_TYPE GetRotationAngle()
const;
306 int GetRotationAnglesXYZ(
double& PhiX,
double& PhiY,
double& PhiZ)
const;
311 {
return GetRotationAnglesXYZ(r[0], r[1], r[2]); }
320 int GetRotationAnglesZYX(
double& PhiX,
double& PhiY,
double& PhiZ)
const;
325 {
return GetRotationAnglesZYX(r[0], r[1], r[2]); }
333 int GetRotationAnglesZXY(
double& PhiX,
double& PhiY,
double& PhiZ)
const;
338 {
return GetRotationAnglesZXY(r[0], r[1], r[2]); }
345 int GetRotationAnglesYXZ(
double& PhiX,
double& PhiY,
double& PhiZ)
const;
350 {
return GetRotationAnglesYXZ(r[0], r[1], r[2]); }
357 int GetRotationAnglesYZX(
double& PhiX,
double& PhiY,
double& PhiZ)
const;
362 {
return GetRotationAnglesYZX(r[0], r[1], r[2]); }
369 int GetRotationAnglesXZY(
double& PhiX,
double& PhiY,
double& PhiZ)
const;
374 {
return GetRotationAnglesXZY(r[0], r[1], r[2]); }
377 friend bool BIASGeometryBase_EXPORT
384 bool Check(
const double eps =
385 std::numeric_limits<double>::epsilon(),
386 const bool verbose =
false)
const;
392 std::string GetCheckFailureReason(
const double eps =
393 std::numeric_limits<double>::epsilon())
const;
397 virtual void EnforceConstraints();
408 #endif // __RMatrixBase_hh__
MatrixInitType
can be passed to matrix constructors to init the matrix with the most often used values ...
void SetYXZ(const Vector3< ROTATION_MATRIX_TYPE > &r)
Set Euler angles (in rad) in order YXZ from vector.
void SetZero()
Setting to zero is forbidden since the zero matrix is not a valid rotation matrix! ...
class BIASGeometryBase_EXPORT RMatrixBase
void SetXYZ(const Vector3< ROTATION_MATRIX_TYPE > &r)
Set Euler angles (in rad) in order XYZ from vector.
int GetRotationAnglesZXY(Vector3< ROTATION_MATRIX_TYPE > &r) const
Get Euler angles for this rotation matrix in order ZXY.
int GetRotationAnglesYXZ(Vector3< ROTATION_MATRIX_TYPE > &r) const
Get Euler angles for this rotation matrix in order YXZ.
int GetRotationAnglesYZX(Vector3< ROTATION_MATRIX_TYPE > &r) const
Get Euler angles for this rotation matrix in order YZX.
void SetXZY(const Vector3< ROTATION_MATRIX_TYPE > &r)
Set Euler angles (in rad) in order XZY from vector.
void SetYZX(const Vector3< ROTATION_MATRIX_TYPE > &r)
Set Euler angles (in rad) in order YZX from vector.
is a 'fixed size' quadratic matrix of dim.
class Vector3 contains a Vector of fixed dim.
Implements a 3D rotation matrix.
int GetRotationAnglesXYZ(Vector3< ROTATION_MATRIX_TYPE > &r) const
Get Euler angles for this rotation matrix in order XYZ.
void SetZXY(const Vector3< ROTATION_MATRIX_TYPE > &r)
Set Euler angles (in rad) in order ZXY from vector.
class for rotation with axis and angle
int GetRotationAnglesXZY(Vector3< ROTATION_MATRIX_TYPE > &r) const
Get Euler angles for this rotation matrix in order XZY.
int GetRotationAnglesZYX(Vector3< ROTATION_MATRIX_TYPE > &r) const
Get Euler angles for this rotation matrix in order ZYX.
void SetZYX(const Vector3< ROTATION_MATRIX_TYPE > &r)
Set Euler angles (in rad) in order ZYX from vector.