template<typename _Scalar, int _Options>
class Eigen::Quaternion< _Scalar, _Options >
The quaternion class used to represent 3D orientations and rotations.
This is defined in the Geometry module.
#include <Eigen/Geometry>
- Template Parameters
-
| _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 \( 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:
-
compact storage (4 scalars)
-
efficient to compose (28 flops),
-
stable spherical interpolation
The following two typedefs are provided for convenience:
-
Quaternionf for float -
Quaterniond for double
- Warning
- Operations interpreting the quaternion as rotation have undefined behavior if the quaternion is not normalized.
- See also
- class AngleAxis, class Transform
|
| template<typename Derived1 , typename Derived2 > |
|
Quaternion< Scalar, Options > |
FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
| |
| |
Quaternion () |
| |
| |
Quaternion (const AngleAxisType &aa) |
| |
| template<typename Derived > |
| |
Quaternion (const MatrixBase< Derived > &other) |
| |
| template<typename OtherScalar , int OtherOptions> |
| |
Quaternion (const Quaternion< OtherScalar, OtherOptions > &other) |
| |
| template<class Derived > |
| |
Quaternion (const QuaternionBase< Derived > &other) |
| |
| |
Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) |
| |
| |
Quaternion (const Scalar *data) |
| |
Public Member Functions inherited from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >
|
|
Vector3 |
_transformVector (const Vector3 &v) const |
| |
| internal::traits< Quaternion< _Scalar, _Options > >::Scalar |
angularDistance (const QuaternionBase< OtherDerived > &other) const |
| |
| internal::cast_return_type< Quaternion< _Scalar, _Options >, Quaternion< NewScalarType > >::type |
cast () const |
| |
| internal::traits< Quaternion< _Scalar, _Options > >::Coefficients & |
coeffs () |
| |
| const internal::traits< Quaternion< _Scalar, _Options > >::Coefficients & |
coeffs () const |
| |
|
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 |
| |
| bool |
operator!= (const QuaternionBase< OtherDerived > &other) const |
| |
|
Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > |
operator* (const QuaternionBase< OtherDerived > &other) const |
| |
|
Quaternion< _Scalar, _Options > & |
operator*= (const QuaternionBase< OtherDerived > &q) |
| |
|
Quaternion< _Scalar, _Options > & |
operator= (const AngleAxisType &aa) |
| |
|
Quaternion< _Scalar, _Options > & |
operator= (const MatrixBase< MatrixDerived > &xpr) |
| |
| bool |
operator== (const QuaternionBase< OtherDerived > &other) const |
| |
|
Quaternion< _Scalar, _Options > & |
setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
| |
|
QuaternionBase & |
setIdentity () |
| |
|
Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > |
slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
| |
|
Scalar |
squaredNorm () const |
| |
|
Matrix3 |
toRotationMatrix () const |
| |
|
VectorBlock< Coefficients, 3 > |
vec () |
| |
| const VectorBlock< const Coefficients, 3 > |
vec () const |
| |
| NonConstCoeffReturnType |
w () |
| |
| CoeffReturnType |
w () const |
| |
| NonConstCoeffReturnType |
x () |
| |
| CoeffReturnType |
x () const |
| |
| NonConstCoeffReturnType |
y () |
| |
| CoeffReturnType |
y () const |
| |
| NonConstCoeffReturnType |
z () |
| |
| CoeffReturnType |
z () const |
| |
Public Member Functions inherited from Eigen::RotationBase< Derived, _Dim >
|
| Derived |
inverse () const |
| |
|
RotationMatrixType |
matrix () const |
| |
| template<typename OtherDerived > |
| internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType |
operator* (const EigenBase< OtherDerived > &e) const |
| |
| template<int Mode, int Options> |
|
Transform< Scalar, Dim, Mode > |
operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
| |
|
Transform< Scalar, Dim, Isometry > |
operator* (const Translation< Scalar, Dim > &t) const |
| |
|
RotationMatrixType |
operator* (const UniformScaling< Scalar > &s) const |
| |
|
RotationMatrixType |
toRotationMatrix () const |
| |
template<typename _Scalar , int _Options>
template<typename Derived1 , typename Derived2 >
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.