Inherited by ei_unaligned_type< Quaternion< _Scalar > >.
This is defined in the Geometry module.
#include <Eigen/Geometry>
_Scalar | the scalar type, i.e., the type of the coefficients |
Quaternionf
for float
Quaterniond
for double
Public Types | |
typedef AngleAxis< Scalar > | AngleAxisType |
typedef Matrix< Scalar, 4, 1 > | Coefficients |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
Public Member Functions | |
Scalar | angularDistance (const Quaternion &other) const |
template<typename NewScalarType> | |
ei_cast_return_type < Quaternion, Quaternion < NewScalarType > >::type | cast () const |
Coefficients & | coeffs () |
const Coefficients & | coeffs () const |
Quaternion | conjugate (void) const |
Scalar | dot (const Quaternion &other) const |
Quaternion | inverse (void) const |
bool | isApprox (const Quaternion &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const |
Scalar | norm () const |
void | normalize () |
Quaternion | normalized () const |
template<typename Derived> | |
Vector3 | operator* (const MatrixBase< Derived > &vec) const |
Quaternion | operator* (const Quaternion &q) const |
Quaternion & | operator*= (const Quaternion &q) |
template<typename Derived> | |
Quaternion & | operator= (const MatrixBase< Derived > &m) |
Quaternion & | operator= (const AngleAxisType &aa) |
Quaternion & | operator= (const Quaternion &other) |
template<typename OtherScalarType> | |
Quaternion (const Quaternion< OtherScalarType > &other) | |
template<typename Derived> | |
Quaternion (const MatrixBase< Derived > &other) | |
Quaternion (const AngleAxisType &aa) | |
Quaternion (const Quaternion &other) | |
Quaternion (Scalar w, Scalar x, Scalar y, Scalar z) | |
Quaternion (ei_constructor_without_unaligned_array_assert) | |
Quaternion () | |
template<typename Derived1, typename Derived2> | |
Quaternion & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
Quaternion & | setIdentity () |
Quaternion | slerp (Scalar t, const Quaternion &other) const |
Scalar | squaredNorm () const |
Matrix3 | toRotationMatrix (void) const |
Block< Coefficients, 3, 1 > | vec () |
const Block< Coefficients, 3, 1 > | vec () const |
Scalar & | w () |
Scalar | w () const |
Scalar & | x () |
Scalar | x () const |
Scalar & | y () |
Scalar | y () const |
Scalar & | z () |
Scalar | z () const |
Static Public Member Functions | |
static Quaternion | Identity () |
Protected Attributes | |
Coefficients | m_coeffs |
typedef AngleAxis<Scalar> AngleAxisType |
the equivalent angle-axis type
typedef Matrix<Scalar, 4, 1> Coefficients |
the type of the Coefficients 4-vector
typedef _Scalar Scalar |
the scalar type of the coefficients
Reimplemented from RotationBase.
Quaternion | ( | ) | [inline] |
Default constructor leaving the quaternion uninitialized.
Quaternion | ( | Scalar | w, | |
Scalar | x, | |||
Scalar | y, | |||
Scalar | z | |||
) | [inline] |
Constructs and initializes the quaternion from its four coefficients w, x, y and z.
x
, y
, z
, w
] Quaternion | ( | const Quaternion< _Scalar > & | other | ) | [inline] |
Copy constructor
Quaternion | ( | const AngleAxisType & | aa | ) | [inline, explicit] |
Constructs and initializes a quaternion from the angle-axis aa
Quaternion | ( | const MatrixBase< Derived > & | other | ) | [inline, explicit] |
Constructs and initializes a quaternion from either:
Quaternion | ( | const Quaternion< OtherScalarType > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
Scalar angularDistance | ( | const Quaternion< _Scalar > & | other | ) | const [inline] |
ei_cast_return_type<Quaternion,Quaternion<NewScalarType> >::type cast | ( | ) | const [inline] |
*this
with scalar type casted to NewScalarType *this
then this function smartly returns a const reference to *this
.
Coefficients& coeffs | ( | ) | [inline] |
const Coefficients& coeffs | ( | ) | const [inline] |
Quaternion< Scalar > conjugate | ( | void | ) | const [inline] |
*this
which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.Scalar dot | ( | const Quaternion< _Scalar > & | other | ) | const [inline] |
*this
and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations. static Quaternion Identity | ( | ) | [inline, static] |
Quaternion< Scalar > inverse | ( | void | ) | const [inline] |
*this
Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.Reimplemented from RotationBase.
bool isApprox | ( | const Quaternion< _Scalar > & | other, | |
typename NumTraits< Scalar >::Real | prec = precision<Scalar>() | |||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Scalar norm | ( | ) | const [inline] |
void normalize | ( | ) | [inline] |
Normalizes the quaternion *this
Quaternion normalized | ( | ) | const [inline] |
Quaternion< Scalar >::Vector3 operator* | ( | const MatrixBase< Derived > & | v | ) | const [inline] |
Rotation of a vector by a quaternion.
Quaternion< Scalar > operator* | ( | const Quaternion< _Scalar > & | other | ) | const [inline] |
Quaternion< Scalar > & operator*= | ( | const Quaternion< _Scalar > & | other | ) | [inline] |
Quaternion< Scalar > & operator= | ( | const MatrixBase< Derived > & | xpr | ) | [inline] |
Set *this
from the expression xpr:
Quaternion< Scalar > & operator= | ( | const AngleAxisType & | aa | ) | [inline] |
Set *this
from an angle-axis aa and returns a reference to *this
Quaternion< Scalar > & setFromTwoVectors | ( | const MatrixBase< Derived1 > & | a, | |
const MatrixBase< Derived2 > & | b | |||
) | [inline] |
Sets *this to be a quaternion representing a rotation sending the vector a to the vector b.
Quaternion& setIdentity | ( | ) | [inline] |
Quaternion< Scalar > slerp | ( | Scalar | t, | |
const Quaternion< _Scalar > & | other | |||
) | const [inline] |
*this
and other at the parameter t Scalar squaredNorm | ( | ) | const [inline] |
Quaternion< Scalar >::Matrix3 toRotationMatrix | ( | void | ) | const [inline] |
Convert the quaternion to a 3x3 rotation matrix
Reimplemented from RotationBase.
Block<Coefficients,3,1> vec | ( | ) | [inline] |
const Block<Coefficients,3,1> vec | ( | ) | const [inline] |
Scalar& w | ( | ) | [inline] |
w
coefficient Scalar w | ( | ) | const [inline] |
w
coefficient Scalar& x | ( | ) | [inline] |
x
coefficient Scalar x | ( | ) | const [inline] |
x
coefficient Scalar& y | ( | ) | [inline] |
y
coefficient Scalar y | ( | ) | const [inline] |
y
coefficient Scalar& z | ( | ) | [inline] |
z
coefficient Scalar z | ( | ) | const [inline] |
z
coefficient