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 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.
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.