26 #ifndef __Quaternion_hh__
27 #define __Quaternion_hh__
29 #include <bias_config.h>
31 #include <Base/Math/Vector4.hh>
32 #include <Base/Math/Vector3.hh>
33 #include <Base/Geometry/RMatrixBase.hh>
34 #include <Base/Geometry/QuaternionOperators.hh>
38 #define QUATERNION_EPSILON 1E-10 // DBL_EPSILON, too small (dherzog)
39 #define QUATERNION_TYPE double
88 template<
class QUAT_TYPE>
104 Quaternion(QUAT_TYPE i, QUAT_TYPE j, QUAT_TYPE k,
107 inline void SetIdentity();
113 inline void SetQuaternion(QUAT_TYPE real, QUAT_TYPE i,
114 QUAT_TYPE j, QUAT_TYPE k);
122 inline void Invert();
127 inline void MakeUnique();
164 const QUAT_TYPE & t)
const;
169 const QUAT_TYPE & t)
const;
183 inline void SetValueAsAxisRad(QUAT_TYPE axisX, QUAT_TYPE axisY,
184 QUAT_TYPE axisZ, QUAT_TYPE angle);
216 QUAT_TYPE GetRotationAngle()
const;
227 int SetXYZ(QUAT_TYPE radX, QUAT_TYPE radY, QUAT_TYPE radZ);
232 int SetZYX(QUAT_TYPE radX, QUAT_TYPE radY, QUAT_TYPE radZ);
237 (*this) /= (QUAT_TYPE)this->NormL2();
255 bool useOtherAngle =
false);
263 static void EnforceRigidCouplingConstraint(
286 #include <Base/Geometry/QuaternionInl.hh>
290 #endif // __Quaternion_hh__
class BIASGeometryBase_EXPORT 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 ...
void Normalize()
Scales quaternion to unit length, i.e.
class Vector4 contains a Vector of dim.
class Vector3 contains a Vector of fixed dim.
Implements a 3D rotation matrix.
is a 'fixed size' quadratic matrix of dim.
class for rotation with axis and angle