![]() |
Eigen
3.3.3
|
The quaternion class used to represent 3D orientations and rotations.
This is defined in the Geometry module.
#include <Eigen/Geometry>
_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
Public Types | |
typedef Base::AngleAxisType | AngleAxisType |
typedef _Scalar | Scalar |
Public Member Functions | |
Coefficients & | coeffs () |
const Coefficients & | coeffs () const |
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) | |
Static Public Member Functions | |
template<typename Derived1 , typename Derived2 > | |
static Quaternion | FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
static Quaternion | UnitRandom () |
typedef Base::AngleAxisType Eigen::Quaternion< _Scalar, _Options >::AngleAxisType |
the equivalent angle-axis type
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
typedef _Scalar Eigen::Quaternion< _Scalar, _Options >::Scalar |
the scalar type of the coefficients
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | ) | [inline] |
Default constructor leaving the quaternion uninitialized.
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const Scalar & | w, |
const Scalar & | x, | ||
const Scalar & | y, | ||
const Scalar & | z | ||
) | [inline] |
Constructs and initializes the quaternion from its four coefficients w, x, y and z.
x
, y
, z
, w
] Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const Scalar * | data | ) | [inline, explicit] |
Constructs and initialize a quaternion from the array data
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const QuaternionBase< Derived > & | other | ) | [inline] |
Copy constructor
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const AngleAxisType & | aa | ) | [inline, explicit] |
Constructs and initializes a quaternion from the angle-axis aa
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const MatrixBase< Derived > & | other | ) | [inline, explicit] |
Constructs and initializes a quaternion from either:
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const Quaternion< OtherScalar, OtherOptions > & | other | ) | [inline, explicit] |
Explicit copy constructor with scalar conversion
Coefficients& Eigen::Quaternion< _Scalar, _Options >::coeffs | ( | ) | [inline] |
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
const Coefficients& Eigen::Quaternion< _Scalar, _Options >::coeffs | ( | ) | const [inline] |
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Quaternion< Scalar, Options > Eigen::Quaternion< Scalar, Options >::FromTwoVectors | ( | const MatrixBase< Derived1 > & | a, |
const MatrixBase< Derived2 > & | b | ||
) | [static] |
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.
Quaternion< Scalar, Options > Eigen::Quaternion< Scalar, Options >::UnitRandom | ( | ) | [static] |