Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Eigen::Quaternion< _Scalar, _Options > Class Template Reference

The quaternion class used to represent 3D orientations and rotations. More...

#include <ForwardDeclarations.h>

Inheritance diagram for Eigen::Quaternion< _Scalar, _Options >:
Inheritance graph
[legend]

Public Types

enum  
 
typedef Base::AngleAxisType AngleAxisType
 
typedef QuaternionBase< Quaternion< _Scalar, _Options > > Base
 
typedef internal::traits< Quaternion >::Coefficients Coefficients
 
typedef _Scalar Scalar
 
- Public Types inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >
enum  
 
typedef AngleAxis< ScalarAngleAxisType
 
typedef RotationBase< Quaternion< _Scalar, _Options >, 3 > Base
 
typedef internal::traits< Quaternion< _Scalar, _Options > >::Coefficients Coefficients
 
typedef Matrix< Scalar, 3, 3 > Matrix3
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef internal::traits< Quaternion< _Scalar, _Options > >::Scalar Scalar
 
typedef Matrix< Scalar, 3, 1 > Vector3
 
- Public Types inherited from Eigen::RotationBase< Quaternion< _Scalar, _Options >, 3 >
enum  
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef internal::traits< Quaternion< _Scalar, _Options > >::Scalar Scalar
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC const Coefficientscoeffs () const
 
template<typename Derived1 , typename Derived2 >
EIGEN_DEVICE_FUNC Quaternion< Scalar, Options > FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
EIGEN_DEVICE_FUNC Quaternion ()
 
EIGEN_DEVICE_FUNC Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z)
 
EIGEN_DEVICE_FUNC Quaternion (const Scalar *data)
 
template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion (const QuaternionBase< Derived > &other)
 
EIGEN_DEVICE_FUNC Quaternion (const AngleAxisType &aa)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Quaternion (const MatrixBase< Derived > &other)
 
template<typename OtherScalar , int OtherOptions>
EIGEN_DEVICE_FUNC Quaternion (const Quaternion< OtherScalar, OtherOptions > &other)
 
- Public Member Functions inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Vector3 _transformVector (const Vector3 &v) const
 
EIGEN_DEVICE_FUNC Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC internal::cast_return_type< Quaternion< _Scalar, _Options >, Quaternion< NewScalarType > >::type cast () const
 
EIGEN_DEVICE_FUNC const internal::traits< Quaternion< _Scalar, _Options > >::Coefficientscoeffs () const
 
EIGEN_DEVICE_FUNC internal::traits< Quaternion< _Scalar, _Options > >::Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarconjugate () const
 
EIGEN_DEVICE_FUNC Scalar dot (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarinverse () const
 
EIGEN_DEVICE_FUNC bool isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC Scalar norm () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarnormalized () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalaroperator* (const QuaternionBase< OtherDerived > &q) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & operator*= (const QuaternionBase< OtherDerived > &q)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Quaternion< _Scalar, _Options > > & operator= (const QuaternionBase< Quaternion< _Scalar, _Options > > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & operator= (const QuaternionBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & operator= (const AngleAxisType &aa)
 
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & operator= (const MatrixBase< OtherDerived > &m)
 
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
EIGEN_DEVICE_FUNC QuaternionBasesetIdentity ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Scalar squaredNorm () const
 
EIGEN_DEVICE_FUNC Matrix3 toRotationMatrix () const
 
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec () const
 
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > vec ()
 
EIGEN_DEVICE_FUNC Scalar w () const
 
EIGEN_DEVICE_FUNC Scalarw ()
 
EIGEN_DEVICE_FUNC Scalar x () const
 
EIGEN_DEVICE_FUNC Scalarx ()
 
EIGEN_DEVICE_FUNC Scalar y () const
 
EIGEN_DEVICE_FUNC Scalary ()
 
EIGEN_DEVICE_FUNC Scalar z () const
 
EIGEN_DEVICE_FUNC Scalarz ()
 
- Public Member Functions inherited from Eigen::RotationBase< Quaternion< _Scalar, _Options >, 3 >
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 
EIGEN_DEVICE_FUNC const Quaternion< _Scalar, _Options > & derived () const
 
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & derived ()
 
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > inverse () const
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > operator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Quaternion< _Scalar, _Options >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType toRotationMatrix () const
 

Static Public Member Functions

template<typename Derived1 , typename Derived2 >
static EIGEN_DEVICE_FUNC Quaternion FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
static EIGEN_DEVICE_FUNC Quaternion UnitRandom ()
 
- Static Public Member Functions inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >
static EIGEN_DEVICE_FUNC Quaternion< ScalarIdentity ()
 

Static Protected Member Functions

static EIGEN_STRONG_INLINE void _check_template_params ()
 

Protected Attributes

Coefficients m_coeffs
 

Detailed Description

template<typename _Scalar, int _Options>
class Eigen::Quaternion< _Scalar, _Options >

The quaternion class used to represent 3D orientations and rotations.

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_Optionscontrols the memory alignment of the coefficients. Can be # AutoAlign or # DontAlign. Default is AutoAlign.

This class represents a quaternion $ w+xi+yj+zk $ that is a convenient representation of orientations and rotations of objects in three dimensions. Compared to other representations like Euler angles or 3x3 matrices, quaternions offer the following advantages:

The following two typedefs are provided for convenience:

Warning
Operations interpreting the quaternion as rotation have undefined behavior if the quaternion is not normalized.
See also
class AngleAxis, class Transform

Definition at line 273 of file ForwardDeclarations.h.

Member Typedef Documentation

template<typename _Scalar, int _Options>
typedef Base::AngleAxisType Eigen::Quaternion< _Scalar, _Options >::AngleAxisType

Definition at line 239 of file Quaternion.h.

template<typename _Scalar, int _Options>
typedef QuaternionBase<Quaternion<_Scalar,_Options> > Eigen::Quaternion< _Scalar, _Options >::Base

Definition at line 230 of file Quaternion.h.

template<typename _Scalar, int _Options>
typedef internal::traits<Quaternion>::Coefficients Eigen::Quaternion< _Scalar, _Options >::Coefficients

Definition at line 238 of file Quaternion.h.

template<typename _Scalar, int _Options>
typedef _Scalar Eigen::Quaternion< _Scalar, _Options >::Scalar

Definition at line 233 of file Quaternion.h.

Member Enumeration Documentation

template<typename _Scalar, int _Options>
anonymous enum

Definition at line 231 of file Quaternion.h.

Constructor & Destructor Documentation

template<typename _Scalar, int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( )
inline

Default constructor leaving the quaternion uninitialized.

Definition at line 242 of file Quaternion.h.

template<typename _Scalar, int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const Scalar w,
const Scalar x,
const Scalar y,
const Scalar z 
)
inline

Constructs and initializes the quaternion $ w+xi+yj+zk $ from its four coefficients w, x, y and z.

Warning
Note the order of the arguments: the real w coefficient first, while internally the coefficients are stored in the following order: [x, y, z, w]

Definition at line 251 of file Quaternion.h.

template<typename _Scalar, int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const Scalar data)
inlineexplicit

Constructs and initialize a quaternion from the array data

Definition at line 254 of file Quaternion.h.

template<typename _Scalar, int _Options>
template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const QuaternionBase< Derived > &  other)
inline

Copy constructor

Definition at line 257 of file Quaternion.h.

template<typename _Scalar, int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const AngleAxisType aa)
inlineexplicit

Constructs and initializes a quaternion from the angle-axis aa

Definition at line 260 of file Quaternion.h.

template<typename _Scalar, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const MatrixBase< Derived > &  other)
inlineexplicit

Constructs and initializes a quaternion from either:

  • a rotation matrix expression,
  • a 4D vector expression representing quaternion coefficients.

Definition at line 267 of file Quaternion.h.

template<typename _Scalar, int _Options>
template<typename OtherScalar , int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const Quaternion< OtherScalar, OtherOptions > &  other)
inlineexplicit

Explicit copy constructor with scalar conversion

Definition at line 271 of file Quaternion.h.

Member Function Documentation

template<typename _Scalar, int _Options>
static EIGEN_STRONG_INLINE void Eigen::Quaternion< _Scalar, _Options >::_check_template_params ( )
inlinestaticprotected

Definition at line 292 of file Quaternion.h.

template<typename _Scalar, int _Options>
EIGEN_DEVICE_FUNC Coefficients& Eigen::Quaternion< _Scalar, _Options >::coeffs ( )
inline

Definition at line 279 of file Quaternion.h.

template<typename _Scalar, int _Options>
EIGEN_DEVICE_FUNC const Coefficients& Eigen::Quaternion< _Scalar, _Options >::coeffs ( ) const
inline

Definition at line 280 of file Quaternion.h.

template<typename _Scalar, int _Options>
template<typename Derived1 , typename Derived2 >
static EIGEN_DEVICE_FUNC Quaternion Eigen::Quaternion< _Scalar, _Options >::FromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)
static
template<typename _Scalar, int _Options>
template<typename Derived1 , typename Derived2 >
EIGEN_DEVICE_FUNC Quaternion<Scalar,Options> Eigen::Quaternion< _Scalar, _Options >::FromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)

Returns 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
resulting quaternion

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

Definition at line 644 of file Quaternion.h.

template<typename Scalar , int Options>
EIGEN_DEVICE_FUNC Quaternion< Scalar, Options > Eigen::Quaternion< Scalar, Options >::UnitRandom ( )
static
Returns
a random unit quaternion following a uniform distribution law on SO(3)
Note
The implementation is based on http://planning.cs.uiuc.edu/node198.html

Definition at line 618 of file Quaternion.h.

Member Data Documentation

template<typename _Scalar, int _Options>
Coefficients Eigen::Quaternion< _Scalar, _Options >::m_coeffs
protected

Definition at line 289 of file Quaternion.h.


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


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:10:19