Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Friends
Eigen::QuaternionBase Class Reference
Inheritance diagram for Eigen::QuaternionBase:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { Flags = Eigen::internal::traits<Derived>::Flags }
typedef internal::traits
< Derived >::Scalar 
Scalar
 the scalar type of the coefficients
typedef NumTraits< Scalar >::Real RealScalar
typedef internal::traits
< Derived >::Coefficients 
Coefficients
typedef Matrix< Scalar, 3, 1 > Vector3
 the type of a 3D vector
typedef Matrix< Scalar, 3, 3 > Matrix3
 the equivalent rotation matrix type
typedef AngleAxis< ScalarAngleAxisType
 the equivalent angle-axis type
enum  
typedef Matrix< Scalar, Dim, Dim > RotationMatrixType
 corresponding linear transformation matrix type
typedef Matrix< Scalar, Dim, 1 > VectorType

Public Member Functions

Scalar x () const
Scalar y () const
Scalar z () const
Scalar w () const
Scalarx ()
Scalary ()
Scalarz ()
Scalarw ()
const VectorBlock< const
Coefficients, 3 > 
vec () const
VectorBlock< Coefficients, 3 > vec ()
const internal::traits
< Derived >::Coefficients
coeffs () const
internal::traits< Derived >
::Coefficients
coeffs ()
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)
 Set *this from an angle-axis aa and returns a reference to *this.
template<class OtherDerived >
Derived & operator= (const MatrixBase< OtherDerived > &m)
QuaternionBasesetIdentity ()
Scalar squaredNorm () const
Scalar norm () const
void normalize ()
 Normalizes the quaternion *this.
Quaternion< Scalarnormalized () const
template<class OtherDerived >
Scalar dot (const QuaternionBase< OtherDerived > &other) const
template<class OtherDerived >
Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
Matrix3 toRotationMatrix () const
 Convert the quaternion to a 3x3 rotation matrix.
template<typename Derived1 , typename Derived2 >
Derived & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b.
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)
Quaternion< Scalarinverse () const
Quaternion< Scalarconjugate () const
template<class OtherDerived >
Quaternion< Scalarslerp (Scalar t, const QuaternionBase< OtherDerived > &other) const
template<class OtherDerived >
bool isApprox (const QuaternionBase< OtherDerived > &other, RealScalar prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_STRONG_INLINE Vector3 _transformVector (Vector3 v) const
 return the result vector of v through the rotation
template<typename NewScalarType >
internal::cast_return_type
< Derived, Quaternion
< NewScalarType > >::type 
cast () const
template<class MatrixDerived >
Derived & operator= (const MatrixBase< MatrixDerived > &xpr)
 Set *this from the expression xpr:
const Derived & derived () const
Derived & derived ()
RotationMatrixType matrix () const
Transform< Scalar, Dim, Isometry > operator* (const Translation< Scalar, Dim > &t) const
RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
EIGEN_STRONG_INLINE
internal::rotation_base_generic_product_selector
< Derived, OtherDerived,
OtherDerived::IsVectorAtCompileTime >
::ReturnType 
operator* (const EigenBase< OtherDerived > &e) const
Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
VectorType _transformVector (const OtherVectorType &v) const

Static Public Member Functions

static Quaternion< ScalarIdentity ()

Private Types

typedef RotationBase< Derived, 3 > Base

Friends

RotationMatrixType operator* (const EigenBase< OtherDerived > &l, const Derived &r)
Transform< Scalar, Dim, Affine > operator* (const DiagonalMatrix< Scalar, Dim > &l, const Derived &r)

Member Typedef Documentation

the equivalent angle-axis type

Reimplemented in Eigen::Quaternion.

Definition at line 63 of file Geometry.

typedef RotationBase<Derived, 3> Eigen::QuaternionBase::Base [private]
typedef internal::traits<Derived>::Coefficients Eigen::QuaternionBase::Coefficients

the equivalent rotation matrix type

Definition at line 61 of file Geometry.

Definition at line 51 of file Geometry.

corresponding linear transformation matrix type

Definition at line 51 of file Geometry.

typedef internal::traits<Derived>::Scalar Eigen::QuaternionBase::Scalar

the scalar type of the coefficients

Reimplemented from Eigen::RotationBase< Derived, 3 >.

Reimplemented in Eigen::Map< Quaternion< _Scalar >, _Options >, Eigen::Map< const Quaternion< _Scalar >, _Options >, and Eigen::Quaternion.

Definition at line 50 of file Geometry.

the type of a 3D vector

Definition at line 59 of file Geometry.

typedef Matrix<Scalar,Dim,1> Eigen::RotationBase::VectorType [inherited]

Definition at line 52 of file Geometry.


Member Enumeration Documentation

anonymous enum [inherited]

Definition at line 46 of file Geometry.

anonymous enum
Enumerator:
Flags 

Definition at line 53 of file Geometry.


Member Function Documentation

VectorType Eigen::RotationBase::_transformVector ( const OtherVectorType &  v) const [inline, inherited]

Definition at line 107 of file Geometry.

EIGEN_STRONG_INLINE QuaternionBase< Derived >::Vector3 Eigen::QuaternionBase::_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 472 of file Geometry.

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

Definition at line 652 of file Geometry.

template<typename NewScalarType >
internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type Eigen::QuaternionBase::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.

Definition at line 184 of file Geometry.

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

Reimplemented in Eigen::Map< Quaternion< _Scalar >, _Options >, Eigen::Map< const Quaternion< _Scalar >, _Options >, and Eigen::Quaternion.

Definition at line 92 of file Geometry.

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

Reimplemented in Eigen::Map< Quaternion< _Scalar >, _Options >, and Eigen::Quaternion.

Definition at line 95 of file Geometry.

Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase::conjugate ( ) 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()

Definition at line 641 of file Geometry.

const Derived& Eigen::RotationBase::derived ( ) const [inline, inherited]

Definition at line 55 of file Geometry.

Derived& Eigen::RotationBase::derived ( ) [inline, inherited]

Definition at line 56 of file Geometry.

template<class OtherDerived >
Scalar Eigen::QuaternionBase::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 141 of file Geometry.

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

Definition at line 113 of file Geometry.

Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase::inverse ( ) 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 Eigen::RotationBase< Derived, 3 >.

Definition at line 620 of file Geometry.

template<class OtherDerived >
bool Eigen::QuaternionBase::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 172 of file Geometry.

RotationMatrixType Eigen::RotationBase::matrix ( ) const [inline, inherited]
Returns:
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.

Definition at line 64 of file Geometry.

Scalar Eigen::QuaternionBase::norm ( ) const [inline]
Returns:
the norm of the quaternion's coefficients
See also:
QuaternionBase::squaredNorm(), MatrixBase::norm()

Definition at line 127 of file Geometry.

void Eigen::QuaternionBase::normalize ( ) [inline]

Normalizes the quaternion *this.

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

Definition at line 131 of file Geometry.

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

Definition at line 134 of file Geometry.

Transform<Scalar,Dim,Isometry> Eigen::RotationBase::operator* ( const Translation< Scalar, Dim > &  t) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a translation t

Definition at line 70 of file Geometry.

RotationMatrixType Eigen::RotationBase::operator* ( const UniformScaling< Scalar > &  s) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a uniform scaling s

Definition at line 74 of file Geometry.

EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType Eigen::RotationBase::operator* ( const EigenBase< OtherDerived > &  e) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim

Definition at line 85 of file Geometry.

Transform<Scalar,Dim,Mode> Eigen::RotationBase::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const [inline, inherited]
Returns:
the concatenation of the rotation *this with a transformation t

Definition at line 103 of file Geometry.

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

Definition at line 445 of file Geometry.

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

Definition at line 457 of file Geometry.

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

Definition at line 485 of file Geometry.

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

Definition at line 493 of file Geometry.

EIGEN_STRONG_INLINE Derived & Eigen::QuaternionBase::operator= ( const AngleAxisType aa)

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

Definition at line 502 of file Geometry.

template<class OtherDerived >
Derived& Eigen::QuaternionBase::operator= ( const MatrixBase< OtherDerived > &  m)
template<class MatrixDerived >
Derived& Eigen::QuaternionBase::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 518 of file Geometry.

template<typename Derived1 , typename Derived2 >
Derived & Eigen::QuaternionBase::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
) [inline]

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b.

Returns:
the quaternion which transform a into b through a rotation

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.

Definition at line 577 of file Geometry.

QuaternionBase& Eigen::QuaternionBase::setIdentity ( ) [inline]
See also:
QuaternionBase::Identity(), MatrixBase::setIdentity()

Definition at line 117 of file Geometry.

template<class OtherDerived >
Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase::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 667 of file Geometry.

Scalar Eigen::QuaternionBase::squaredNorm ( ) const [inline]
Returns:
the squared norm of the quaternion's coefficients
See also:
QuaternionBase::norm(), MatrixBase::squaredNorm()

Definition at line 122 of file Geometry.

QuaternionBase< Derived >::Matrix3 Eigen::QuaternionBase::toRotationMatrix ( void  ) const [inline]

Convert the quaternion to a 3x3 rotation matrix.

Returns:
an equivalent 3x3 rotation matrix

The quaternion is required to be normalized, otherwise the result is undefined.

Reimplemented from Eigen::RotationBase< Derived, 3 >.

Definition at line 531 of file Geometry.

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

Definition at line 86 of file Geometry.

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

Definition at line 89 of file Geometry.

Scalar Eigen::QuaternionBase::w ( ) const [inline]
Returns:
the w coefficient

Definition at line 74 of file Geometry.

Scalar& Eigen::QuaternionBase::w ( ) [inline]
Returns:
a reference to the w coefficient

Definition at line 83 of file Geometry.

Scalar Eigen::QuaternionBase::x ( ) const [inline]
Returns:
the x coefficient

Definition at line 68 of file Geometry.

Scalar& Eigen::QuaternionBase::x ( ) [inline]
Returns:
a reference to the x coefficient

Definition at line 77 of file Geometry.

Scalar Eigen::QuaternionBase::y ( ) const [inline]
Returns:
the y coefficient

Definition at line 70 of file Geometry.

Scalar& Eigen::QuaternionBase::y ( ) [inline]
Returns:
a reference to the y coefficient

Definition at line 79 of file Geometry.

Scalar Eigen::QuaternionBase::z ( ) const [inline]
Returns:
the z coefficient

Definition at line 72 of file Geometry.

Scalar& Eigen::QuaternionBase::z ( ) [inline]
Returns:
a reference to the z coefficient

Definition at line 81 of file Geometry.


Friends And Related Function Documentation

RotationMatrixType operator* ( const EigenBase< OtherDerived > &  l,
const Derived &  r 
) [friend, inherited]
Returns:
the concatenation of a linear transformation l with the rotation r

Definition at line 90 of file Geometry.

Transform<Scalar,Dim,Affine> operator* ( const DiagonalMatrix< Scalar, Dim > &  l,
const Derived &  r 
) [friend, inherited]
Returns:
the concatenation of a scaling l with the rotation r

Definition at line 94 of file Geometry.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011