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:
- 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< Scalar_, Options_ > & | operator*= (const QuaternionBase< OtherDerived > &q) |
| |
| Quaternion & | operator= (Quaternion &&other) noexcept(std::is_nothrow_move_assignable< Scalar >::value) |
| |
| | 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) |
| |
| template<typename Derived> |
| | Quaternion (const Scalar &w, const Eigen::MatrixBase< Derived > &vec) |
| |
| | Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) |
| |
| | Quaternion (const Scalar *data) |
| |
| | Quaternion (Quaternion &&other) noexcept(std::is_nothrow_move_constructible< Scalar >::value) |
| |
| Vector3 | _transformVector (const Vector3 &v) const |
| |
| Vector3 | _transformVector (const Vector3 &v) const |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) 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::cast_return_type< Quaternion< Scalar_, Options_ >, Quaternion< NewScalarType > >::type | cast () const |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients & | coeffs () |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients & | coeffs () |
| |
| const internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients & | coeffs () const |
| |
| const internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients & | coeffs () const |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients | coeffsScalarFirst () const |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients | coeffsScalarFirst () const |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients | coeffsScalarLast () const |
| |
| internal::traits< Quaternion< Scalar_, Options_ > >::Coefficients | coeffsScalarLast () const |
| |
| Quaternion< Scalar > | conjugate () const |
| |
| Quaternion< Scalar > | conjugate () const |
| |
| Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
| |
| Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
| |
| Quaternion< Scalar > | inverse () const |
| |
| Quaternion< Scalar > | inverse () const |
| |
| bool | isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
| |
| bool | isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
| |
| Scalar | norm () const |
| |
| Scalar | norm () const |
| |
| void | normalize () |
| |
| void | normalize () |
| |
| Quaternion< Scalar > | normalized () const |
| |
| Quaternion< Scalar > | normalized () const |
| |
| bool | operator!= (const QuaternionBase< OtherDerived > &other) const |
| |
| bool | operator!= (const QuaternionBase< OtherDerived > &other) const |
| |
| internal::rotation_base_generic_product_selector< Quaternion< Scalar_, Options_ >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
| |
| Quaternion< typename internal::traits< Quaternion< Scalar_, Options_ > >::Scalar > | operator* (const QuaternionBase< OtherDerived > &other) const |
| |
| Quaternion< typename internal::traits< Quaternion< Scalar_, Options_ > >::Scalar > | operator* (const QuaternionBase< OtherDerived > &other) const |
| |
| 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 |
| |
| Quaternion< Scalar_, Options_ > & | operator*= (const QuaternionBase< OtherDerived > &q) |
| |
| Quaternion< Scalar_, Options_ > & | operator= (const AngleAxisType &aa) |
| |
| Quaternion< Scalar_, Options_ > & | operator= (const MatrixBase< MatrixDerived > &xpr) |
| |
| Quaternion< Scalar_, Options_ > & | operator= (const MatrixBase< MatrixDerived > &xpr) |
| |
| bool | operator== (const QuaternionBase< OtherDerived > &other) const |
| |
| bool | operator== (const QuaternionBase< OtherDerived > &other) const |
| |
| Quaternion< Scalar_, Options_ > & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
| |
| Quaternion< Scalar_, Options_ > & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
| |
| QuaternionBase & | setIdentity () |
| |
| QuaternionBase & | setIdentity () |
| |
| Quaternion< typename internal::traits< Quaternion< Scalar_, Options_ > >::Scalar > | slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
| |
| Quaternion< typename internal::traits< Quaternion< Scalar_, Options_ > >::Scalar > | slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
| |
| Scalar | squaredNorm () const |
| |
| Scalar | squaredNorm () const |
| |
| Matrix3 | toRotationMatrix () const |
| |
| Matrix3 | toRotationMatrix () const |
| |
| VectorBlock< Coefficients, 3 > | vec () |
| |
| VectorBlock< Coefficients, 3 > | vec () |
| |
| const VectorBlock< const Coefficients, 3 > | vec () const |
| |
| const VectorBlock< const Coefficients, 3 > | vec () const |
| |
| constexpr NonConstCoeffReturnType | w () |
| |
| constexpr NonConstCoeffReturnType | w () |
| |
| constexpr CoeffReturnType | w () const |
| |
| constexpr CoeffReturnType | w () const |
| |
| constexpr NonConstCoeffReturnType | x () |
| |
| constexpr NonConstCoeffReturnType | x () |
| |
| constexpr CoeffReturnType | x () const |
| |
| constexpr CoeffReturnType | x () const |
| |
| constexpr NonConstCoeffReturnType | y () |
| |
| constexpr NonConstCoeffReturnType | y () |
| |
| constexpr CoeffReturnType | y () const |
| |
| constexpr CoeffReturnType | y () const |
| |
| constexpr NonConstCoeffReturnType | z () |
| |
| constexpr NonConstCoeffReturnType | z () |
| |
| constexpr CoeffReturnType | z () const |
| |
| constexpr CoeffReturnType | z () const |
| |
| 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 |
| |