Public Types | Public Member Functions | Static Public Member Functions | Private Types
QuaternionBase< Derived > Class Template Reference

#include <Quaternion.h>

Inheritance diagram for QuaternionBase< Derived >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { Flags = Eigen::internal::traits<Derived>::Flags }
typedef AngleAxis< ScalarAngleAxisType
typedef internal::traits
< Derived >::Coefficients 
Coefficients
typedef Matrix< Scalar, 3, 3 > Matrix3
typedef NumTraits< Scalar >::Real RealScalar
typedef internal::traits
< Derived >::Scalar 
Scalar
typedef Matrix< Scalar, 3, 1 > Vector3

Public Member Functions

EIGEN_STRONG_INLINE Vector3 _transformVector (Vector3 v) const
template<class OtherDerived >
Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
template<typename NewScalarType >
internal::cast_return_type
< Derived, Quaternion
< NewScalarType > >::type 
cast () const
const internal::traits
< Derived >::Coefficients
coeffs () const
internal::traits< Derived >
::Coefficients
coeffs ()
Quaternion< Scalarconjugate () const
template<class OtherDerived >
Scalar dot (const QuaternionBase< OtherDerived > &other) const
Quaternion< Scalarinverse () const
template<class OtherDerived >
bool isApprox (const QuaternionBase< OtherDerived > &other, RealScalar prec=NumTraits< Scalar >::dummy_precision()) const
Scalar norm () const
void normalize ()
Quaternion< Scalarnormalized () const
template<class OtherDerived >
EIGEN_STRONG_INLINE Quaternion
< Scalar
operator* (const QuaternionBase< OtherDerived > &q) const
template<class OtherDerived >
EIGEN_STRONG_INLINE Derived & operator*= (const QuaternionBase< OtherDerived > &q)
EIGEN_STRONG_INLINE
QuaternionBase< Derived > & 
operator= (const QuaternionBase< Derived > &other)
template<class OtherDerived >
EIGEN_STRONG_INLINE Derived & operator= (const QuaternionBase< OtherDerived > &other)
Derived & operator= (const AngleAxisType &aa)
template<class OtherDerived >
Derived & operator= (const MatrixBase< OtherDerived > &m)
template<class MatrixDerived >
Derived & operator= (const MatrixBase< MatrixDerived > &xpr)
template<typename Derived1 , typename Derived2 >
Derived & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
QuaternionBasesetIdentity ()
template<class OtherDerived >
Quaternion< Scalarslerp (Scalar t, const QuaternionBase< OtherDerived > &other) const
Scalar squaredNorm () const
Matrix3 toRotationMatrix () const
const VectorBlock< const
Coefficients, 3 > 
vec () const
VectorBlock< Coefficients, 3 > vec ()
Scalar w () const
Scalarw ()
Scalar x () const
Scalarx ()
Scalar y () const
Scalary ()
Scalar z () const
Scalarz ()

Static Public Member Functions

static Quaternion< ScalarIdentity ()

Private Types

typedef RotationBase< Derived, 3 > Base

Detailed Description

template<class Derived>
class QuaternionBase< Derived >

Definition at line 42 of file Geometry/Quaternion.h.


Member Typedef Documentation

template<class Derived>
typedef AngleAxis<Scalar> QuaternionBase< Derived >::AngleAxisType
template<class Derived>
typedef RotationBase<Derived, 3> QuaternionBase< Derived >::Base [private]
template<class Derived>
typedef internal::traits<Derived>::Coefficients QuaternionBase< Derived >::Coefficients
template<class Derived>
typedef Matrix<Scalar,3,3> QuaternionBase< Derived >::Matrix3

the equivalent rotation matrix type

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 60 of file Geometry/Quaternion.h.

template<class Derived>
typedef NumTraits<Scalar>::Real QuaternionBase< Derived >::RealScalar

Definition at line 50 of file Geometry/Quaternion.h.

template<class Derived>
typedef internal::traits<Derived>::Scalar QuaternionBase< Derived >::Scalar
template<class Derived>
typedef Matrix<Scalar,3,1> QuaternionBase< Derived >::Vector3

the type of a 3D vector

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 58 of file Geometry/Quaternion.h.


Member Enumeration Documentation

template<class Derived>
anonymous enum
Enumerator:
Flags 

Definition at line 52 of file Geometry/Quaternion.h.


Member Function Documentation

template<class Derived >
EIGEN_STRONG_INLINE QuaternionBase< Derived >::Vector3 QuaternionBase< Derived >::_transformVector ( Vector3  v) const

return the result vector of v through the rotation

Rotation of a vector by a quaternion.

Remarks:
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
  • Quaternion2: 30n
  • Via a Matrix3: 24 + 15n

Definition at line 471 of file Geometry/Quaternion.h.

template<class Derived >
template<class OtherDerived >
internal::traits< Derived >::Scalar QuaternionBase< Derived >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const [inline]
Returns:
the angle (in radian) between two rotations
See also:
dot()

Definition at line 651 of file Geometry/Quaternion.h.

template<class Derived>
template<typename NewScalarType >
internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type QuaternionBase< Derived >::cast ( ) const [inline]
Returns:
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 183 of file Geometry/Quaternion.h.

template<class Derived>
const internal::traits<Derived>::Coefficients& QuaternionBase< Derived >::coeffs ( ) const [inline]
template<class Derived>
internal::traits<Derived>::Coefficients& QuaternionBase< Derived >::coeffs ( ) [inline]
Returns:
a vector expression of the coefficients (x,y,z,w)

Reimplemented in Map< Quaternion< _Scalar >, _Options >, Quaternion< _Scalar >, Quaternion< double >, Quaternion< float >, Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 94 of file Geometry/Quaternion.h.

template<class Derived >
Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::conjugate ( void  ) const [inline]
Returns:
the conjugated quaternion
the conjugate of the *this which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
See also:
Quaternion2::inverse()

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 640 of file Geometry/Quaternion.h.

template<class Derived>
template<class OtherDerived >
Scalar QuaternionBase< Derived >::dot ( const QuaternionBase< OtherDerived > &  other) const [inline]
Returns:
the dot product of *this and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
See also:
angularDistance()

Definition at line 140 of file Geometry/Quaternion.h.

template<class Derived>
static Quaternion<Scalar> QuaternionBase< Derived >::Identity ( ) [inline, static]
Returns:
a quaternion representing an identity rotation
See also:
MatrixBase::Identity()

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 112 of file Geometry/Quaternion.h.

template<class Derived >
Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::inverse ( void  ) const [inline]
Returns:
the quaternion describing the inverse rotation
the multiplicative inverse of *this Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.
See also:
QuaternionBase::conjugate()

Reimplemented from RotationBase< Derived, 3 >.

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 619 of file Geometry/Quaternion.h.

template<class Derived>
template<class OtherDerived >
bool QuaternionBase< Derived >::isApprox ( const QuaternionBase< OtherDerived > &  other,
RealScalar  prec = NumTraits<Scalar>::dummy_precision() 
) const [inline]
Returns:
true if *this is approximately equal to other, within the precision determined by prec.
See also:
MatrixBase::isApprox()

Definition at line 171 of file Geometry/Quaternion.h.

template<class Derived>
Scalar QuaternionBase< Derived >::norm ( ) const [inline]
Returns:
the norm of the quaternion's coefficients
See also:
QuaternionBase::squaredNorm(), MatrixBase::norm()

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 126 of file Geometry/Quaternion.h.

template<class Derived>
void QuaternionBase< Derived >::normalize ( void  ) [inline]

Normalizes the quaternion *this

See also:
normalized(), MatrixBase::normalize()

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 130 of file Geometry/Quaternion.h.

template<class Derived>
Quaternion<Scalar> QuaternionBase< Derived >::normalized ( ) const [inline]
Returns:
a normalized copy of *this
See also:
normalize(), MatrixBase::normalized()

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 133 of file Geometry/Quaternion.h.

template<class Derived >
template<class OtherDerived >
EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::operator* ( const QuaternionBase< OtherDerived > &  other) const
Returns:
the concatenation of two rotations as a quaternion-quaternion product

Definition at line 444 of file Geometry/Quaternion.h.

template<class Derived >
template<class OtherDerived >
EIGEN_STRONG_INLINE Derived & QuaternionBase< Derived >::operator*= ( const QuaternionBase< OtherDerived > &  other)
See also:
operator*(Quaternion)

Definition at line 456 of file Geometry/Quaternion.h.

template<class Derived>
EIGEN_STRONG_INLINE QuaternionBase< Derived > & QuaternionBase< Derived >::operator= ( const QuaternionBase< Derived > &  other)

Definition at line 484 of file Geometry/Quaternion.h.

template<class Derived >
template<class OtherDerived >
EIGEN_STRONG_INLINE Derived & QuaternionBase< Derived >::operator= ( const QuaternionBase< OtherDerived > &  other)

Definition at line 492 of file Geometry/Quaternion.h.

template<class Derived>
EIGEN_STRONG_INLINE Derived & QuaternionBase< Derived >::operator= ( const AngleAxisType aa)

Set *this from an angle-axis aa and returns a reference to *this

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 501 of file Geometry/Quaternion.h.

template<class Derived>
template<class OtherDerived >
Derived& QuaternionBase< Derived >::operator= ( const MatrixBase< OtherDerived > &  m)
template<class Derived>
template<class MatrixDerived >
Derived& QuaternionBase< Derived >::operator= ( const MatrixBase< MatrixDerived > &  xpr) [inline]

Set *this from the expression xpr:

  • if xpr is a 4x1 vector, then xpr is assumed to be a quaternion
  • if xpr is a 3x3 matrix, then xpr is assumed to be rotation matrix and xpr is converted to a quaternion

Definition at line 517 of file Geometry/Quaternion.h.

template<class Derived >
template<typename Derived1 , typename Derived2 >
Derived & QuaternionBase< Derived >::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
) [inline]
Returns:
the quaternion which transform a into b through a rotation

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns:
a reference to *this.

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 576 of file Geometry/Quaternion.h.

template<class Derived>
QuaternionBase& QuaternionBase< Derived >::setIdentity ( ) [inline]
template<class Derived >
template<class OtherDerived >
Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::slerp ( Scalar  t,
const QuaternionBase< OtherDerived > &  other 
) const
Returns:
an interpolation for a constant motion between other and *this t in [0;1] see http://en.wikipedia.org/wiki/Slerp
the spherical linear interpolation between the two quaternions *this and other at the parameter t

Definition at line 666 of file Geometry/Quaternion.h.

template<class Derived>
Scalar QuaternionBase< Derived >::squaredNorm ( ) const [inline]
Returns:
the squared norm of the quaternion's coefficients
See also:
QuaternionBase::norm(), MatrixBase::squaredNorm()

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 121 of file Geometry/Quaternion.h.

template<class Derived >
QuaternionBase< Derived >::Matrix3 QuaternionBase< Derived >::toRotationMatrix ( void  ) const [inline]
Returns:
an equivalent 3x3 rotation matrix

Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.

Reimplemented from RotationBase< Derived, 3 >.

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 530 of file Geometry/Quaternion.h.

template<class Derived>
const VectorBlock<const Coefficients,3> QuaternionBase< Derived >::vec ( ) const [inline]
Returns:
a read-only vector expression of the imaginary part (x,y,z)

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 85 of file Geometry/Quaternion.h.

template<class Derived>
VectorBlock<Coefficients,3> QuaternionBase< Derived >::vec ( ) [inline]
Returns:
a vector expression of the imaginary part (x,y,z)

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 88 of file Geometry/Quaternion.h.

template<class Derived>
Scalar QuaternionBase< Derived >::w ( ) const [inline]
Returns:
the w coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 73 of file Geometry/Quaternion.h.

template<class Derived>
Scalar& QuaternionBase< Derived >::w ( ) [inline]
Returns:
a reference to the w coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 82 of file Geometry/Quaternion.h.

template<class Derived>
Scalar QuaternionBase< Derived >::x ( ) const [inline]
Returns:
the x coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 67 of file Geometry/Quaternion.h.

template<class Derived>
Scalar& QuaternionBase< Derived >::x ( ) [inline]
Returns:
a reference to the x coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 76 of file Geometry/Quaternion.h.

template<class Derived>
Scalar QuaternionBase< Derived >::y ( ) const [inline]
Returns:
the y coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 69 of file Geometry/Quaternion.h.

template<class Derived>
Scalar& QuaternionBase< Derived >::y ( ) [inline]
Returns:
a reference to the y coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 78 of file Geometry/Quaternion.h.

template<class Derived>
Scalar QuaternionBase< Derived >::z ( ) const [inline]
Returns:
the z coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 71 of file Geometry/Quaternion.h.

template<class Derived>
Scalar& QuaternionBase< Derived >::z ( ) [inline]
Returns:
a reference to the z coefficient

Reimplemented in Quaternion< _Scalar >, Quaternion< double >, and Quaternion< float >.

Definition at line 80 of file Geometry/Quaternion.h.


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


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:18