![]() |
Eigen
3.3.4
|
The quaternion class used to represent 3D orientations and rotations.
This is defined in the Geometry module.
| _Scalar | the scalar type, i.e., the type of the coefficients |
| _Options | controls the memory alignment of the coefficients. Can be # AutoAlign or # DontAlign. Default is AutoAlign. |
This class represents a quaternion
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:
Quaternionf for float Quaterniond for double
Inheritance diagram for Eigen::Quaternion< Scalar, Options >:Public Member Functions | |
| template<typename Derived1 , typename Derived2 > | |
| Quaternion< Scalar, Options > | FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
| Quaternion () | |
| Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) | |
| Quaternion (const Scalar *data) | |
| template<class Derived > | |
| Quaternion (const QuaternionBase< Derived > &other) | |
| Quaternion (const AngleAxisType &aa) | |
| template<typename Derived > | |
| Quaternion (const MatrixBase< Derived > &other) | |
| template<typename OtherScalar , int OtherOptions> | |
| Quaternion (const Quaternion< OtherScalar, OtherOptions > &other) | |
Public Member Functions inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > > | |
| Vector3 | _transformVector (const Vector3 &v) const |
| internal::cast_return_type < Quaternion< _Scalar, _Options >, Quaternion < NewScalarType > >::type | cast () const |
| const internal::traits < Quaternion< _Scalar, _Options > >::Coefficients & | coeffs () const |
| internal::traits< Quaternion < _Scalar, _Options > >::Coefficients & | coeffs () |
| Quaternion< Scalar > | conjugate () const |
| Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
| Quaternion< Scalar > | inverse () const |
| bool | isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
| Scalar | norm () const |
| void | normalize () |
| Quaternion< Scalar > | normalized () const |
| Quaternion< _Scalar, _Options > & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
| QuaternionBase & | setIdentity () |
| Scalar | squaredNorm () const |
| Matrix3 | toRotationMatrix () const |
| const VectorBlock< const Coefficients, 3 > | vec () const |
| VectorBlock< Coefficients, 3 > | vec () |
| Scalar | w () const |
| Scalar & | w () |
| Scalar | x () const |
| Scalar & | x () |
| Scalar | y () const |
| Scalar & | y () |
| Scalar | z () const |
| Scalar & | z () |
Public Member Functions inherited from Eigen::RotationBase< Quaternion< _Scalar, _Options >, 3 > | |
| Quaternion< _Scalar, _Options > | inverse () const |
| RotationMatrixType | matrix () const |
| Transform< Scalar, Dim, Isometry > | operator* (const Translation< Scalar, Dim > &t) const |
| RotationMatrixType | operator* (const UniformScaling< Scalar > &s) const |
| internal::rotation_base_generic_product_selector < Quaternion< _Scalar, _Options >, OtherDerived, OtherDerived::IsVectorAtCompileTime > ::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
| Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
| RotationMatrixType | toRotationMatrix () const |
Static Public Member Functions | |
| static Quaternion | UnitRandom () |
Static Public Member Functions inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > > | |
| static Quaternion< Scalar > | Identity () |
Additional Inherited Members | |
Public Types inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > > | |
| typedef AngleAxis< Scalar > | AngleAxisType |
| typedef Matrix< Scalar, 3, 3 > | Matrix3 |
| typedef Matrix< Scalar, 3, 1 > | Vector3 |
Public Types inherited from Eigen::RotationBase< Quaternion< _Scalar, _Options >, 3 > | |
| typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
| typedef internal::traits < Quaternion< _Scalar, _Options > >::Scalar | Scalar |
|
inline |
Default constructor leaving the quaternion uninitialized.
|
inline |
Constructs and initializes the quaternion
from its four coefficients w, x, y and z.
x, y, z, w]
|
inlineexplicit |
Constructs and initialize a quaternion from the array data
|
inline |
Copy constructor
|
inlineexplicit |
Constructs and initializes a quaternion from the angle-axis aa
|
inlineexplicit |
Constructs and initializes a quaternion from either:
|
inlineexplicit |
Explicit copy constructor with scalar conversion
| 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.
Note that the two input vectors do not have to be normalized, and do not need to have the same norm.
|
static |