Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Related Functions | List of all members
BIAS::Quaternion< T > Class Template Reference

class for rotation with axis and angle More...

#include <Base/Geometry/DualQuaternionOperators.hh>

+ Inheritance diagram for BIAS::Quaternion< T >:
+ Collaboration diagram for BIAS::Quaternion< T >:

Public Types

typedef QUAT_TYPE value_type
 

Public Member Functions

void Add (const QUAT_TYPE &scalar, Vector4< QUAT_TYPE > &dest) const
 Addition with a scalar, storing results in destionation vector. More...
 
void Add (const Vector4< QUAT_TYPE > &argvec, Vector4< QUAT_TYPE > &destvec) const
 adding of two vectors, storing the result in destvec More...
 
void AddIP (const QUAT_TYPE &scalar)
 Addition (in place) of an scalar. More...
 
void AddIP (const Vector4< QUAT_TYPE > &argvec)
 in place adding More...
 
void clear ()
 
void Copy (const QUAT_TYPE *pv)
 copy the array of vectorsize beginning at *T to this->data_ More...
 
double Dist (const Vector4< QUAT_TYPE > &vec) const
 Return the euclidean distance of 2 vectors. More...
 
void Divide (const QUAT_TYPE &scalar, Vector4< QUAT_TYPE > &dest) const
 Division with a scalar, storing results in destionation vector. More...
 
void DivideIP (const QUAT_TYPE &scalar)
 Division (in place) of an scalar. More...
 
void ElementwiseProduct (const Vector4< QUAT_TYPE > &argvec, Vector4< QUAT_TYPE > &destvec) const
 multiply two vectors elementwise, storing the result in destvec More...
 
void EnforceRigidCouplingConstraint (Quaternion< QUAT_TYPE > &other, bool useOtherAngle=false)
 Enforce rigid coupling constraint for this and the other given unit quaternion (equal rotation angle/equal scalar part for both). More...
 
int GetAxisAngle (Vector3< QUAT_TYPE > &axis, QUAT_TYPE &angle) const
 Returns rotation in axis and angle notation (angle in radians). More...
 
const QUAT_TYPE * GetData () const
 
get the data pointer

the member function itself is const (before {..}) because it doesn't change the this object. More...

 
QUAT_TYPE * GetData ()
 
void GetEquatorialPoint3D (Vector3< QUAT_TYPE > &p3D) const
 Compute minimal parametrization of unit quaternion by projecting it from the 4d hypersphere onto the 3d equatorial space, as described in: [TCBS+12] Terzakis et al. More...
 
const unsigned int GetNumElements () const
 
Matrix4x4< QUAT_TYPE > GetQuaternionMultMatrixLeft () const
 Returns matrix which expresses (left) quaternion multiplication. More...
 
Matrix4x4< QUAT_TYPE > GetQuaternionMultMatrixRight () const
 Returns matrix which expresses right quaternion multiplication. More...
 
QUAT_TYPE GetRotationAngle () const
 Returns rotation angle notation in radians. More...
 
Vector3< QUAT_TYPE > GetRotationAxis () const
 Returns rotation axis. More...
 
int GetRotationMatrix (RMatrixBase &R) const
 Returns a corresponding (quaternion) rotation matrix. More...
 
Quaternion< QUAT_TYPE > Interpolate (const Quaternion< QUAT_TYPE > &to, const QUAT_TYPE &t) const
 Spherical interpolation between this and given quaternion. More...
 
Quaternion< QUAT_TYPE > InterpolateLinear (const Quaternion< QUAT_TYPE > &to, const QUAT_TYPE &t) const
 Linear interpolation between this and given quaternion. More...
 
Quaternion< QUAT_TYPE > Inverse () const
 returns the Inverse rotation Quaternion More...
 
void Invert ()
 inverts this, by changing the rotation axis by *=-1 More...
 
bool Load (const std::string &filename)
 method to load directly from a given filename. More...
 
void MakeUnique ()
 makes Quaternion-representation uniqe, ensuring vector lies in upper (by real part) hemisphere. More...
 
void Mult (const Quaternion< QUAT_TYPE > &quat)
 quaternion multiplication: this= this * quat More...
 
void Mult (const Quaternion< QUAT_TYPE > &arg, Quaternion< QUAT_TYPE > &res) const
 quaternion multiplication: res = this * arg More...
 
void Multiply (const QUAT_TYPE &scalar, Vector4< QUAT_TYPE > &dest) const
 Multiplication with a scalar, storing results in destionation vector. More...
 
void MultiplyIP (const QUAT_TYPE &scalar)
 Multiplication (in place) of an scalar. More...
 
void MultLeft (const Quaternion< QUAT_TYPE > &quat)
 quaternion multiplication: this = quat * this More...
 
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 More...
 
Vector3< QUAT_TYPE > MultVec (const Vector3< QUAT_TYPE > &vec) const
 
void Normalize ()
 Scales quaternion to unit length, i.e. More...
 
QUAT_TYPE NormL1 () const
 Return the L1 norm: |a| + |b| + |c|+ |d|. More...
 
double NormL2 () const
 Return the L2 norm: sqrt(a^2 + b^2 + c^2 + d^2) More...
 
bool operator!= (const Vector4< QUAT_TYPE > &arg) const
 Comparison operator 'not equal'. More...
 
Vector4< QUAT_TYPE > & operator*= (const QUAT_TYPE &scalar)
 Multiplication operator with scalar argument. More...
 
Vector4< QUAT_TYPE > & operator+= (const QUAT_TYPE &scalar)
 Addition operator with scalar argument. More...
 
Vector4< QUAT_TYPE > & operator+= (const Vector4< QUAT_TYPE > &argvec)
 add operator for two Vectors More...
 
Vector4< QUAT_TYPE > & operator-= (const QUAT_TYPE &scalar)
 Substraction operator with scalar argument. More...
 
Vector4< QUAT_TYPE > & operator-= (const Vector4< QUAT_TYPE > &argvec)
 sub operator for two Vectors More...
 
Vector4< QUAT_TYPE > & operator/= (const QUAT_TYPE &scalar)
 Division operator with scalar argument. More...
 
Quaternion< QUAT_TYPE > & operator= (const Quaternion< QUAT_TYPE > &vec)
 assignment operator More...
 
bool operator== (const Vector4< QUAT_TYPE > &arg) const
 Comparison operator 'equal'. More...
 
const QUAT_TYPE & operator[] (const int i) const
 access an element of the vector with 0-based indizes. More...
 
QUAT_TYPE & operator[] (const int i)
 access an element of the vector with 0-based indizes. More...
 
Matrix4x4< QUAT_TYPE > OuterProduct (const Vector4< QUAT_TYPE > &v) const
 outer product, constructs a matrix. More...
 
Quaternion< QUAT_TYPE > Power (const QUAT_TYPE &scale) const
 Computes this^(scale), which scales the angle from axis/angle- representation with 'scale'. More...
 
 Quaternion ()
 
 Quaternion (const Vector4< QUAT_TYPE > &q)
 
 Quaternion (const Quaternion< QUAT_TYPE > &q)
 copy constructor More...
 
 Quaternion (QUAT_TYPE i, QUAT_TYPE j, QUAT_TYPE k, QUAT_TYPE r)
 
bool Save (const std::string &filename) const
 method to save directly to a given filename. More...
 
void ScalarProduct (const Vector4< QUAT_TYPE > &argvec, QUAT_TYPE &result) const
 
scalar product (=inner product) of two vectors, storing

the result in result More...

 
QUAT_TYPE ScalarProduct (const Vector4< QUAT_TYPE > &argvec) const
 
void Set (const QUAT_TYPE &scalar)
 set all elements to a scalat value More...
 
void Set (const QUAT_TYPE &x, const QUAT_TYPE &y, const QUAT_TYPE &z, const QUAT_TYPE &w)
 set elementwise with given scalr values More...
 
void SetFromEquatorialPoint3D (const Vector3< QUAT_TYPE > &p3D)
 Set unit quaternion from 3d point in equatorial space by back- projecting it onto the 4d hypersphere, as described in [TCBS+12]. More...
 
void SetIdentity ()
 
void SetQuaternion (QUAT_TYPE real, QUAT_TYPE i, QUAT_TYPE j, QUAT_TYPE k)
 Sets all parts of quaternion in mathematical order, real part first, then 1.,2. More...
 
void SetValueAsAxisRad (const Vector3< QUAT_TYPE > &axis, QUAT_TYPE angle)
 sets the quaternion with given rotation axis and angle (in rad) More...
 
void SetValueAsAxisRad (QUAT_TYPE axisX, QUAT_TYPE axisY, QUAT_TYPE axisZ, QUAT_TYPE angle)
 sets the quaternion with given rotation axis and angle (in rad) More...
 
int SetXYZ (QUAT_TYPE radX, QUAT_TYPE radY, QUAT_TYPE radZ)
 Sets quaternion as concatenated rotations around x,y,z-axis; this = q_x * q_y * q_z (BIAS-RMatrix conform) More...
 
void SetZero ()
 set all values to 0 More...
 
int SetZYX (QUAT_TYPE radX, QUAT_TYPE radY, QUAT_TYPE radZ)
 Sets quaternion as concatenated rotations around x,y,z-axis; this = q_z * q_y * q_x (BIAS-RMatrix conform) More...
 
const unsigned int Size () const
 
const unsigned int size () const
 
void Sub (const QUAT_TYPE &scalar, Vector4< QUAT_TYPE > &dest) const
 Substraction with a scalar, storing results in destionation vector. More...
 
void Sub (const Vector4< QUAT_TYPE > &argvec, Vector4< QUAT_TYPE > &destvec) const
 subtracting of two Vectors, storing the result in destvec More...
 
void SubIP (const QUAT_TYPE &scalar)
 Substraction (in place) of an scalar. More...
 
void SubIP (const Vector4< QUAT_TYPE > &argvec)
 in place substraction More...
 
Matrix< QUAT_TYPE > transposed () const
 
return a new Matrix with 1 row and 4 columns representing a

transposed vector More...

 
 ~Quaternion ()
 
Iterator Functions
QUAT_TYPEconst * begin () const
 Iterator to first component of vector. More...
 
QUAT_TYPE * begin ()
 
QUAT_TYPEconst * end () const
 Iterator pointing to one element after the last vector element. More...
 
QUAT_TYPE * end ()
 

Static Public Member Functions

static void EnforceRigidCouplingConstraint (std::vector< Quaternion< QUAT_TYPE > > &quats, bool useFirstAngle=false)
 Enforce rigid coupling constraint for all quaternions in given vector. More...
 

Protected Attributes

QUAT_TYPE data_ [VECTOR4SIZE]
 

Related Functions

(Note that these are not member functions.)

template<class T >
Quaternion< T > operator* (const Quaternion< T > &l, const Quaternion< T > &r)
 
template<class T >
Quaternion< T > & operator*= (Quaternion< T > &l, const Quaternion< T > &r)
 
template<class T >
Quaternion< T > operator/ (const Quaternion< T > &l, const Quaternion< T > &r)
 
template<class T >
Quaternion< T > & operator/= (Quaternion< T > &l, const Quaternion< T > &r)
 

Detailed Description

template<class T>
class BIAS::Quaternion< T >

class for rotation with axis and angle

Test:
tested with TestRotationConversion.cpp

Quaternions can be used for rotation around an axis through the origin by spcecifing the normal direction vector of the axis and an angle.

The rotation for positive angles is clockwise, when looking in direction of the axis.

Contains qx=[0], qy=[1], qz=[2], qw=[3].

Not every quaternion describes a rotation. Only quaternions of the form:

qx = x * sin(phi/2) , which is the imaginary part i

qy = y * sin(phi/2) , which is the imaginary part j

qz = z * sin(phi/2) , which is the imaginary part k

qw = cos(phi/2), , which is the real part

where (x, y, z) is the normalized direction vector of the axis and phi is the angle of rtoation.

Some usefull quaternions: x y z w Description 0 0 0 1 Identity quaternion, no rotation 1 0 0 0 180' turn around X axis 0 1 0 0 180' turn around Y axis 0 0 1 0 180' turn around Z axis sqrt(0.5) 0 0 sqrt(0.5) 90' rotation around X axis 0 sqrt(0.5) 0 sqrt(0.5) 90' rotation around Y axis 0 0 sqrt(0.5) sqrt(0.5) 90' rotation around Z axis -sqrt(0.5) 0 0 sqrt(0.5) -90' rotation around X axis 0 -sqrt(0.5) 0 sqrt(0.5) -90' rotation around Y axis 0 0 -sqrt(0.5) sqrt(0.5) -90' rotation around Z axis

Author
grest 06/2003

Definition at line 32 of file DualQuaternionOperators.hh.

Member Typedef Documentation

typedef QUAT_TYPE BIAS::Vector4< QUAT_TYPE >::value_type
inherited

Definition at line 67 of file Vector4.hh.

Constructor & Destructor Documentation

template<class T>
BIAS::Quaternion< T >::~Quaternion ( )
template<class T>
BIAS::Quaternion< T >::Quaternion ( )
template<class T>
BIAS::Quaternion< T >::Quaternion ( const Vector4< QUAT_TYPE > &  q)
template<class QUAT_TYPE >
BIAS::Quaternion< QUAT_TYPE >::Quaternion ( const Quaternion< QUAT_TYPE > &  q)
inline

copy constructor

Author
Daniel Grest (06/2003)

Definition at line 28 of file Quaternion.hh.

template<class T>
BIAS::Quaternion< T >::Quaternion ( QUAT_TYPE  i,
QUAT_TYPE  j,
QUAT_TYPE  k,
QUAT_TYPE  r 
)

Member Function Documentation

void BIAS::Vector4< QUAT_TYPE >::Add ( const QUAT_TYPE &  scalar,
Vector4< QUAT_TYPE > &  dest 
) const
inlineinherited

Addition with a scalar, storing results in destionation vector.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::Add ( const Vector4< QUAT_TYPE > &  argvec,
Vector4< QUAT_TYPE > &  destvec 
) const
inlineinherited

adding of two vectors, storing the result in destvec

Author
Ingo Thomsen tested
void BIAS::Vector4< QUAT_TYPE >::AddIP ( const QUAT_TYPE &  scalar)
inlineinherited

Addition (in place) of an scalar.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::AddIP ( const Vector4< QUAT_TYPE > &  argvec)
inlineinherited

in place adding

Author
Ingo Thomsen tested
QUAT_TYPE const* BIAS::Vector4< QUAT_TYPE >::begin ( ) const
inlineinherited

Iterator to first component of vector.

Author
Stefan Reinhold

Definition at line 152 of file Vector4.hh.

QUAT_TYPE * BIAS::Vector4< QUAT_TYPE >::begin ( )
inlineinherited

Definition at line 155 of file Vector4.hh.

void BIAS::Vector4< QUAT_TYPE >::clear ( )
inlineinherited
void BIAS::Vector4< QUAT_TYPE >::Copy ( const QUAT_TYPE *  pv)
inlineinherited

copy the array of vectorsize beginning at *T to this->data_

Author
Jan Woetzel untested (02/28/2002)
double BIAS::Vector4< QUAT_TYPE >::Dist ( const Vector4< QUAT_TYPE > &  vec) const
inlineinherited

Return the euclidean distance of 2 vectors.

Author
Birger Streckel
Date
08/2002
void BIAS::Vector4< QUAT_TYPE >::Divide ( const QUAT_TYPE &  scalar,
Vector4< QUAT_TYPE > &  dest 
) const
inlineinherited

Division with a scalar, storing results in destionation vector.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::DivideIP ( const QUAT_TYPE &  scalar)
inlineinherited

Division (in place) of an scalar.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::ElementwiseProduct ( const Vector4< QUAT_TYPE > &  argvec,
Vector4< QUAT_TYPE > &  destvec 
) const
inlineinherited

multiply two vectors elementwise, storing the result in destvec

Author
Jan Woetzel untested (03/06/2002)
QUAT_TYPE const* BIAS::Vector4< QUAT_TYPE >::end ( ) const
inlineinherited

Iterator pointing to one element after the last vector element.

Author
Stefan Reinhold

Definition at line 161 of file Vector4.hh.

QUAT_TYPE * BIAS::Vector4< QUAT_TYPE >::end ( )
inlineinherited

Definition at line 164 of file Vector4.hh.

template<class T>
void BIAS::Quaternion< T >::EnforceRigidCouplingConstraint ( Quaternion< QUAT_TYPE > &  other,
bool  useOtherAngle = false 
)

Enforce rigid coupling constraint for this and the other given unit quaternion (equal rotation angle/equal scalar part for both).

Computes direct simple interpolation of both unit quaternion where the scalar parts of the resulting unit quaternion are identical. This solution can be used as initial guess for numerical refinement.

Parameters
in/out]other Quaternion to enforce rigid coupling constraint with
[in]useOtherAngleUse rotation angle (= scalar part) of other quaternion instead of interpolating both
Author
esquivel 02/2012
template<class T>
static void BIAS::Quaternion< T >::EnforceRigidCouplingConstraint ( std::vector< Quaternion< QUAT_TYPE > > &  quats,
bool  useFirstAngle = false 
)
static

Enforce rigid coupling constraint for all quaternions in given vector.

Parameters
in/out]quats Quaternions to enforce rigid coupling constraint for
[in]useFirstAngleUse rotation angle (= scalar part) of first quaternion instead of interpolating all
Author
esquivel 02/2012
template<class T>
int BIAS::Quaternion< T >::GetAxisAngle ( Vector3< QUAT_TYPE > &  axis,
QUAT_TYPE &  angle 
) const

Returns rotation in axis and angle notation (angle in radians).

Note that the returned angle resides in the interval [0,PI) and the axis points into the according direction!

Author
woelk 12 2002

Referenced by BIAS::RMatrixBase::GetRotationAxisAngle(), BIAS::PMDImageProc::MetaFromPoseAndK(), BIAS::operator<<(), and BIAS::CovQuaternion2AxisAngle::Transform_().

const QUAT_TYPE * BIAS::Vector4< QUAT_TYPE >::GetData ( ) const
inlineinherited

get the data pointer

the member function itself is const (before {..}) because it doesn't change the this object.

Returns
the const pointer to the data array for reading
Author
Jan Woetzel untested (02/28/2002)

Definition at line 177 of file Vector4.hh.

QUAT_TYPE * BIAS::Vector4< QUAT_TYPE >::GetData ( )
inlineinherited

Definition at line 181 of file Vector4.hh.

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::GetEquatorialPoint3D ( Vector3< QUAT_TYPE > &  p3D) const
inline

Compute minimal parametrization of unit quaternion by projecting it from the 4d hypersphere onto the 3d equatorial space, as described in: [TCBS+12] Terzakis et al.

: A Recipe on the Parameterization of Rotation Matrices for Non-Linear Optimization using Quaternions, 2012.

Parameters
[out]p3DReturns 3d point representation of unit quaternion
Author
esquivel 07/2013

Definition at line 212 of file Quaternion.hh.

const unsigned int BIAS::Vector4< QUAT_TYPE >::GetNumElements ( ) const
inlineinherited

Definition at line 145 of file Vector4.hh.

template<class T>
Matrix4x4<QUAT_TYPE> BIAS::Quaternion< T >::GetQuaternionMultMatrixLeft ( ) const

Returns matrix which expresses (left) quaternion multiplication.

A quaternions stored in an object can be understood as a 4-vector q =(ix iy iz r)^T. Left multiplying a quaternion q2 with a quaternion q1 can be expressed in terms of matrix multiplication as qRes = q1*q2 = M(q1)*q2. This method returns the matrix M(*this).

Referenced by BIAS::PoseParametrizationCovariance::Transform().

template<class T>
Matrix4x4<QUAT_TYPE> BIAS::Quaternion< T >::GetQuaternionMultMatrixRight ( ) const

Returns matrix which expresses right quaternion multiplication.

Right multiplying a quaternion q1 with quaternion q2 can be expressed as qRes = q1*q2 = N(q2)*q1. This method returns the matrix N(*this).

template<class T>
QUAT_TYPE BIAS::Quaternion< T >::GetRotationAngle ( ) const

Returns rotation angle notation in radians.

Note that the returned angle resides in the interval [0,PI)!

Referenced by BIAS::EMatrix::GetRotationTranslation().

template<class T>
Vector3<QUAT_TYPE> BIAS::Quaternion< T >::GetRotationAxis ( ) const

Returns rotation axis.

See GetRotationAxisAngle().

Referenced by BIAS::EMatrix::GetRotationTranslation().

template<class T>
int BIAS::Quaternion< T >::GetRotationMatrix ( RMatrixBase R) const

Returns a corresponding (quaternion) rotation matrix.

Deprecated:
Transpose problem! This function is going to be removed! Use RMatrixBase::SetFromQuaternion() instead!
Author
grest
template<class T>
Quaternion<QUAT_TYPE> BIAS::Quaternion< T >::Interpolate ( const Quaternion< QUAT_TYPE > &  to,
const QUAT_TYPE &  t 
) const

Spherical interpolation between this and given quaternion.

Note
Quaternions are assumed to be unit quaternions!

Referenced by BIAS::DualQuaternion< QUAT_TYPE >::Interpolate().

template<class T>
Quaternion<QUAT_TYPE> BIAS::Quaternion< T >::InterpolateLinear ( const Quaternion< QUAT_TYPE > &  to,
const QUAT_TYPE &  t 
) const

Linear interpolation between this and given quaternion.

Note
Quaternions are assumed to be unit quaternions!

Referenced by BIAS::DualQuaternion< QUAT_TYPE >::InterpolateLinear().

template<class QUAT_TYPE >
Quaternion< QUAT_TYPE > BIAS::Quaternion< QUAT_TYPE >::Inverse ( ) const
inline

returns the Inverse rotation Quaternion

Definition at line 42 of file Quaternion.hh.

Referenced by BIAS::Quaternion< T >::operator/(), and BIAS::Quaternion< T >::operator/=().

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::Invert ( )
inline

inverts this, by changing the rotation axis by *=-1

Definition at line 34 of file Quaternion.hh.

Referenced by BIAS::Quaternion< QUAT_TYPE >::Inverse(), and BIAS::EParametrization::Invert().

bool BIAS::Vector4< QUAT_TYPE >::Load ( const std::string &  filename)
inherited

method to load directly from a given filename.

internally using stream operator

Author
Jan Woetzel 09/2005
Returns
false in case of error, true in case of success
template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::MakeUnique ( )
inline

makes Quaternion-representation uniqe, ensuring vector lies in upper (by real part) hemisphere.

(inplace)

Definition at line 50 of file Quaternion.hh.

Referenced by BIAS::Quaternion< QUAT_TYPE >::EnforceRigidCouplingConstraint().

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::Mult ( const Quaternion< QUAT_TYPE > &  quat)
inline
template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::Mult ( const Quaternion< QUAT_TYPE > &  arg,
Quaternion< QUAT_TYPE > &  res 
) const
inline

quaternion multiplication: res = this * arg

Definition at line 98 of file Quaternion.hh.

void BIAS::Vector4< QUAT_TYPE >::Multiply ( const QUAT_TYPE &  scalar,
Vector4< QUAT_TYPE > &  dest 
) const
inlineinherited

Multiplication with a scalar, storing results in destionation vector.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::MultiplyIP ( const QUAT_TYPE &  scalar)
inlineinherited

Multiplication (in place) of an scalar.

Author
Ingo Thomsen

Referenced by BIAS::RMatrixBase::GetQuaternion().

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::MultLeft ( const Quaternion< QUAT_TYPE > &  quat)
inline

quaternion multiplication: this = quat * this

Definition at line 106 of file Quaternion.hh.

template<class QUAT_TYPE >
int BIAS::Quaternion< QUAT_TYPE >::MultVec ( const Vector3< QUAT_TYPE > &  vec,
Vector3< QUAT_TYPE > &  res 
) const
inline
template<class QUAT_TYPE >
Vector3< QUAT_TYPE > BIAS::Quaternion< QUAT_TYPE >::MultVec ( const Vector3< QUAT_TYPE > &  vec) const
inline

Definition at line 161 of file Quaternion.hh.

template<class T>
void BIAS::Quaternion< T >::Normalize ( )
inline
QUAT_TYPE BIAS::Vector4< QUAT_TYPE >::NormL1 ( ) const
inlineinherited

Return the L1 norm: |a| + |b| + |c|+ |d|.

Author
Ingo Thomsen
Date
04/11/2002 untested
double BIAS::Vector4< QUAT_TYPE >::NormL2 ( ) const
inlineinherited

Return the L2 norm: sqrt(a^2 + b^2 + c^2 + d^2)

Author
Ingo Thomsen
Date
04/11/2002 untested

Referenced by BIAS::RMatrixBase::GetQuaternion(), and BIAS::RMatrixBase::SetFromQuaternion().

bool BIAS::Vector4< QUAT_TYPE >::operator!= ( const Vector4< QUAT_TYPE > &  arg) const
inlineinherited

Comparison operator 'not equal'.

Author
Ingo Thomsen
Vector4<QUAT_TYPE >& BIAS::Vector4< QUAT_TYPE >::operator*= ( const QUAT_TYPE &  scalar)
inlineinherited

Multiplication operator with scalar argument.

Author
Ingo Thomsen tested
Vector4<QUAT_TYPE >& BIAS::Vector4< QUAT_TYPE >::operator+= ( const QUAT_TYPE &  scalar)
inlineinherited

Addition operator with scalar argument.

Author
Ingo Thomsen tested
Vector4<QUAT_TYPE >& BIAS::Vector4< QUAT_TYPE >::operator+= ( const Vector4< QUAT_TYPE > &  argvec)
inlineinherited

add operator for two Vectors

Author
Ingo Thomsen tested
Vector4<QUAT_TYPE >& BIAS::Vector4< QUAT_TYPE >::operator-= ( const QUAT_TYPE &  scalar)
inlineinherited

Substraction operator with scalar argument.

Author
Ingo Thomsen tested
Vector4<QUAT_TYPE >& BIAS::Vector4< QUAT_TYPE >::operator-= ( const Vector4< QUAT_TYPE > &  argvec)
inlineinherited

sub operator for two Vectors

Author
Ingo Thomsen tested
Vector4<QUAT_TYPE >& BIAS::Vector4< QUAT_TYPE >::operator/= ( const QUAT_TYPE &  scalar)
inlineinherited

Division operator with scalar argument.

Author
Ingo Thomsen tested
template<class T>
Quaternion<QUAT_TYPE>& BIAS::Quaternion< T >::operator= ( const Quaternion< QUAT_TYPE > &  vec)

assignment operator

Author
grest 06 2003
bool BIAS::Vector4< QUAT_TYPE >::operator== ( const Vector4< QUAT_TYPE > &  arg) const
inlineinherited

Comparison operator 'equal'.

Author
Ingo Thomsen tested
const QUAT_TYPE & BIAS::Vector4< QUAT_TYPE >::operator[] ( const int  i) const
inlineinherited

access an element of the vector with 0-based indizes.

read only (no write) member funciton const because it doesn't change this object

Author
Jan Woetzel alpha (03/01/2002)
QUAT_TYPE & BIAS::Vector4< QUAT_TYPE >::operator[] ( const int  i)
inlineinherited

access an element of the vector with 0-based indizes.

write allowed

Author
Jan Woetzel alpha (03/01/2002)
Matrix4x4<QUAT_TYPE > BIAS::Vector4< QUAT_TYPE >::OuterProduct ( const Vector4< QUAT_TYPE > &  v) const
inherited

outer product, constructs a matrix.

Often written as v * v^T for col vectors

Author
frick
template<class T>
Quaternion<QUAT_TYPE> BIAS::Quaternion< T >::Power ( const QUAT_TYPE &  scale) const

Computes this^(scale), which scales the angle from axis/angle- representation with 'scale'.

This is the same like inter-/extra- polating between (0,0,0,1)-quaternion and this!

bool BIAS::Vector4< QUAT_TYPE >::Save ( const std::string &  filename) const
inherited

method to save directly to a given filename.

internally using stream operator

Author
Jan Woetzel 09/2009
Returns
false in case of error, true in case of success
void BIAS::Vector4< QUAT_TYPE >::ScalarProduct ( const Vector4< QUAT_TYPE > &  argvec,
QUAT_TYPE &  result 
) const
inlineinherited

scalar product (=inner product) of two vectors, storing

the result in result

Author
Jan Woetzel untested
Examples:
ExampleQuaternion.cpp.
QUAT_TYPE BIAS::Vector4< QUAT_TYPE >::ScalarProduct ( const Vector4< QUAT_TYPE > &  argvec) const
inlineinherited
void BIAS::Vector4< QUAT_TYPE >::Set ( const QUAT_TYPE &  scalar)
inlineinherited

set all elements to a scalat value

Author
Jan Woetzel untested (02/28/2002)
void BIAS::Vector4< QUAT_TYPE >::Set ( const QUAT_TYPE &  x,
const QUAT_TYPE &  y,
const QUAT_TYPE &  z,
const QUAT_TYPE &  w 
)
inlineinherited

set elementwise with given scalr values

Author
Jan Woetzel, Ingo Thomsen tested (02/28/2002)
template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::SetFromEquatorialPoint3D ( const Vector3< QUAT_TYPE > &  p3D)
inline

Set unit quaternion from 3d point in equatorial space by back- projecting it onto the 4d hypersphere, as described in [TCBS+12].

Parameters
[in]p3DConstaint 3d point representation of unit quaternion
See Also
GetEquatorialPoint3D
Author
esquivel 07/2013

Definition at line 223 of file Quaternion.hh.

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::SetIdentity ( )
inline

Definition at line 168 of file Quaternion.hh.

Referenced by BIAS::Quaternion< QUAT_TYPE >::Power().

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::SetQuaternion ( QUAT_TYPE  real,
QUAT_TYPE  i,
QUAT_TYPE  j,
QUAT_TYPE  k 
)
inline

Sets all parts of quaternion in mathematical order, real part first, then 1.,2.

and 3. imaginary part

Definition at line 175 of file Quaternion.hh.

template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::SetValueAsAxisRad ( const Vector3< QUAT_TYPE > &  axis,
QUAT_TYPE  angle 
)
inline
template<class QUAT_TYPE >
void BIAS::Quaternion< QUAT_TYPE >::SetValueAsAxisRad ( QUAT_TYPE  axisX,
QUAT_TYPE  axisY,
QUAT_TYPE  axisZ,
QUAT_TYPE  angle 
)
inline

sets the quaternion with given rotation axis and angle (in rad)

Returns
0 in case of no error
Author
Daniel Grest, June 2003

Definition at line 190 of file Quaternion.hh.

template<class T>
int BIAS::Quaternion< T >::SetXYZ ( QUAT_TYPE  radX,
QUAT_TYPE  radY,
QUAT_TYPE  radZ 
)

Sets quaternion as concatenated rotations around x,y,z-axis; this = q_x * q_y * q_z (BIAS-RMatrix conform)

Author
herzog 2005-07-19
void BIAS::Vector4< QUAT_TYPE >::SetZero ( )
inlineinherited

set all values to 0

Author
Jan Woetzel
template<class T>
int BIAS::Quaternion< T >::SetZYX ( QUAT_TYPE  radX,
QUAT_TYPE  radY,
QUAT_TYPE  radZ 
)

Sets quaternion as concatenated rotations around x,y,z-axis; this = q_z * q_y * q_x (BIAS-RMatrix conform)

Author
herzog 2005-07-19

Referenced by BIAS::CovTransformPose::Transform_().

const unsigned int BIAS::Vector4< QUAT_TYPE >::Size ( ) const
inlineinherited
@return the size of this vector
Author
Jan Woetzel (02/28/2002)
const unsigned int BIAS::Vector4< QUAT_TYPE >::size ( ) const
inlineinherited
void BIAS::Vector4< QUAT_TYPE >::Sub ( const QUAT_TYPE &  scalar,
Vector4< QUAT_TYPE > &  dest 
) const
inlineinherited

Substraction with a scalar, storing results in destionation vector.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::Sub ( const Vector4< QUAT_TYPE > &  argvec,
Vector4< QUAT_TYPE > &  destvec 
) const
inlineinherited

subtracting of two Vectors, storing the result in destvec

Author
Ingo Thomsen tested
void BIAS::Vector4< QUAT_TYPE >::SubIP ( const QUAT_TYPE &  scalar)
inlineinherited

Substraction (in place) of an scalar.

Author
Ingo Thomsen
void BIAS::Vector4< QUAT_TYPE >::SubIP ( const Vector4< QUAT_TYPE > &  argvec)
inlineinherited

in place substraction

Author
Ingo Thomsen tested
Matrix<QUAT_TYPE > BIAS::Vector4< QUAT_TYPE >::transposed ( ) const
inlineinherited

return a new Matrix with 1 row and 4 columns representing a

transposed vector

Friends And Related Function Documentation

template<class T >
Quaternion< T > operator* ( const Quaternion< T > &  l,
const Quaternion< T > &  r 
)
related

what it stands for (wraps Mult())

Author
herzog 2005-07-15

Definition at line 42 of file QuaternionOperators.hh.

References BIAS::Quaternion< T >::Mult().

template<class T >
Quaternion< T > & operator*= ( Quaternion< T > &  l,
const Quaternion< T > &  r 
)
related

what it stands for (wraps Mult())

Author
herzog 2005-07-15

Definition at line 54 of file QuaternionOperators.hh.

References BIAS::Quaternion< T >::Mult().

template<class T >
Quaternion< T > operator/ ( const Quaternion< T > &  l,
const Quaternion< T > &  r 
)
related

what it stands for (wraps Mult() and Inverse())

Author
herzog 2005-07-15

Definition at line 65 of file QuaternionOperators.hh.

References BIAS::Quaternion< T >::Inverse(), and BIAS::Quaternion< T >::Mult().

template<class T >
Quaternion< T > & operator/= ( Quaternion< T > &  l,
const Quaternion< T > &  r 
)
related

what it stands for (wraps Mult() and Inverse())

Author
herzog 2005-07-15

Definition at line 77 of file QuaternionOperators.hh.

References BIAS::Quaternion< T >::Inverse(), and BIAS::Quaternion< T >::Mult().

Member Data Documentation

QUAT_TYPE BIAS::Vector4< QUAT_TYPE >::data_[VECTOR4SIZE]
protectedinherited

Definition at line 375 of file Vector4.hh.


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