|
EIGEN_DEVICE_FUNC | Quaternion () |
| Default constructor leaving the quaternion uninitialized. More...
|
|
EIGEN_DEVICE_FUNC | Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) |
| Constructs and initializes the quaternion \( w+xi+yj+zk \) from its four coefficients w, x, y and z. More...
|
|
EIGEN_DEVICE_FUNC | Quaternion (const Scalar *data) |
| Constructs and initialize a quaternion from the array data.
|
|
template<class Derived > |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE | Quaternion (const QuaternionBase< Derived > &other) |
| Copy constructor.
|
|
EIGEN_DEVICE_FUNC | Quaternion (const AngleAxisType &aa) |
| Constructs and initializes a quaternion from the angle-axis aa.
|
|
template<typename Derived > |
EIGEN_DEVICE_FUNC | Quaternion (const MatrixBase< Derived > &other) |
| Constructs and initializes a quaternion from either: More...
|
|
template<typename OtherScalar , int OtherOptions> |
EIGEN_DEVICE_FUNC | Quaternion (const Quaternion< OtherScalar, OtherOptions > &other) |
| Explicit copy constructor with scalar conversion.
|
|
EIGEN_DEVICE_FUNC Coefficients & | coeffs () |
|
EIGEN_DEVICE_FUNC const Coefficients & | coeffs () const |
|
template<typename Derived1 , typename Derived2 > |
EIGEN_DEVICE_FUNC 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. More...
|
|
EIGEN_DEVICE_FUNC Scalar | x () const |
|
EIGEN_DEVICE_FUNC Scalar & | x () |
|
EIGEN_DEVICE_FUNC Scalar | y () const |
|
EIGEN_DEVICE_FUNC Scalar & | y () |
|
EIGEN_DEVICE_FUNC Scalar | z () const |
|
EIGEN_DEVICE_FUNC Scalar & | z () |
|
EIGEN_DEVICE_FUNC Scalar | w () const |
|
EIGEN_DEVICE_FUNC Scalar & | w () |
|
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > | vec () const |
|
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > | vec () |
|
EIGEN_DEVICE_FUNC const internal::traits< Quaternion< _Scalar, _Options > >::Coefficients & | coeffs () const |
|
EIGEN_DEVICE_FUNC internal::traits< Quaternion< _Scalar, _Options > >::Coefficients & | coeffs () |
|
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) |
| Set *this from an angle-axis aa and returns a reference to *this .
|
|
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & | operator= (const MatrixBase< OtherDerived > &m) |
|
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & | operator= (const MatrixBase< MatrixDerived > &xpr) |
| Set *this from the expression xpr: More...
|
|
EIGEN_DEVICE_FUNC QuaternionBase & | setIdentity () |
|
EIGEN_DEVICE_FUNC Scalar | squaredNorm () const |
|
EIGEN_DEVICE_FUNC Scalar | norm () const |
|
EIGEN_DEVICE_FUNC void | normalize () |
| Normalizes the quaternion *this . More...
|
|
EIGEN_DEVICE_FUNC Quaternion< Scalar > | normalized () const |
|
EIGEN_DEVICE_FUNC Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
|
EIGEN_DEVICE_FUNC Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
|
EIGEN_DEVICE_FUNC internal::traits< Quaternion< _Scalar, _Options > >::Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
|
EIGEN_DEVICE_FUNC Matrix3 | toRotationMatrix () const |
| Convert the quaternion to a 3x3 rotation matrix. More...
|
|
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & | 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. More...
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalar > | operator* (const QuaternionBase< OtherDerived > &q) const |
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > | operator* (const QuaternionBase< OtherDerived > &other) const |
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & | operator*= (const QuaternionBase< OtherDerived > &q) |
|
EIGEN_DEVICE_FUNC Quaternion< Scalar > | inverse () const |
|
EIGEN_DEVICE_FUNC Quaternion< Scalar > | conjugate () const |
|
EIGEN_DEVICE_FUNC Quaternion< Scalar > | slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
|
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > | slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
|
EIGEN_DEVICE_FUNC bool | isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Vector3 | _transformVector (const Vector3 &v) const |
| return the result vector of v through the rotation More...
|
|
EIGEN_DEVICE_FUNC internal::cast_return_type< Quaternion< _Scalar, _Options >, Quaternion< NewScalarType > >::type | cast () const |
|
EIGEN_DEVICE_FUNC const Quaternion< _Scalar, _Options > & | derived () const |
|
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & | derived () |
|
EIGEN_DEVICE_FUNC RotationMatrixType | toRotationMatrix () const |
|
EIGEN_DEVICE_FUNC RotationMatrixType | matrix () const |
|
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > | inverse () 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 VectorType | _transformVector (const OtherVectorType &v) const |
|
template<typename _Scalar, int _Options>
class Eigen::Quaternion< _Scalar, _Options >
The quaternion class used to represent 3D orientations and rotations
- 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