Eigen::QuaternionBase
template<class Derived>
class Eigen::QuaternionBase< Derived >
Base class for quaternion expressions.
This is defined in the Geometry module.
#include <Eigen/Geometry>
-
Template Parameters
-
Derived |
derived type (CRTP) |
-
See also
-
class Quaternion
|
Vector3 |
_transformVector (const Vector3 &v) const |
|
template<class OtherDerived > |
internal::traits< Derived >::Scalar |
angularDistance (const QuaternionBase< OtherDerived > &other) const |
|
template<typename NewScalarType > |
internal::cast_return_type< Derived, Quaternion< NewScalarType > >::type |
cast () const |
|
internal::traits< Derived >::Coefficients & |
coeffs () |
|
const internal::traits< Derived >::Coefficients & |
coeffs () const |
|
Quaternion< Scalar > |
conjugate () const |
|
template<class OtherDerived > |
Scalar |
dot (const QuaternionBase< OtherDerived > &other) const |
|
Quaternion< Scalar > |
inverse () const |
|
template<class OtherDerived > |
bool |
isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
|
Scalar |
norm () const |
|
void |
normalize () |
|
Quaternion< Scalar > |
normalized () const |
|
template<class OtherDerived > |
bool |
operator!= (const QuaternionBase< OtherDerived > &other) const |
|
template<class OtherDerived > |
Quaternion< typename internal::traits< Derived >::Scalar > |
operator* (const QuaternionBase< OtherDerived > &other) const |
|
template<class OtherDerived > |
Derived & |
operator*= (const QuaternionBase< OtherDerived > &q) |
|
Derived & |
operator= (const AngleAxisType &aa) |
|
template<class MatrixDerived > |
Derived & |
operator= (const MatrixBase< MatrixDerived > &xpr) |
|
template<class OtherDerived > |
bool |
operator== (const QuaternionBase< OtherDerived > &other) const |
|
template<typename Derived1 , typename Derived2 > |
Derived & |
setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
|
QuaternionBase & |
setIdentity () |
|
template<class OtherDerived > |
Quaternion< typename internal::traits< Derived >::Scalar > |
slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
|
Scalar |
squaredNorm () const |
|
Matrix3 |
toRotationMatrix () const |
|
VectorBlock< Coefficients, 3 > |
vec () |
|
const VectorBlock< const Coefficients, 3 > |
vec () const |
|
NonConstCoeffReturnType |
w () |
|
CoeffReturnType |
w () const |
|
NonConstCoeffReturnType |
x () |
|
CoeffReturnType |
x () const |
|
NonConstCoeffReturnType |
y () |
|
CoeffReturnType |
y () const |
|
NonConstCoeffReturnType |
z () |
|
CoeffReturnType |
z () const |
|
Public Member Functions inherited from Eigen::RotationBase< Derived, 3 > |
Derived |
inverse () const |
|
RotationMatrixType |
matrix () const |
|
internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType |
operator* (const EigenBase< OtherDerived > &e) 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 |
|
RotationMatrixType |
toRotationMatrix () const |
|
AngleAxisType
the equivalent angle-axis type
Matrix3
the equivalent rotation matrix type
Vector3
return the result vector of v through the rotation
Rotation of a vector by a quaternion.
-
Remarks
-
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
- Quaternion2: 30n
- Via a Matrix3: 24 + 15n
angularDistance()
template<class Derived >
template<class OtherDerived >
-
Returns
-
the angle (in radian) between two rotations
-
See also
- dot()
cast()
template<class Derived >
template<typename NewScalarType >
-
Returns
*this
with scalar type casted to NewScalarType
Note that if NewScalarType is equal to the current scalar type of *this
then this function smartly returns a const reference to *this
.
coeffs() [1/2]
-
Returns
-
a vector expression of the coefficients (x,y,z,w)
coeffs() [2/2]
-
Returns
-
a read-only vector expression of the coefficients (x,y,z,w)
conjugate()
-
Returns
-
the conjugated quaternion
-
the conjugate of the
*this
which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
-
See also
-
Quaternion2::inverse()
dot()
template<class Derived >
template<class OtherDerived >
-
Returns
-
the dot product of
*this
and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
-
See also
-
angularDistance()
Identity()
inverse()
-
Returns
-
the quaternion describing the inverse rotation
-
the multiplicative inverse of
*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.
-
See also
- QuaternionBase::conjugate()
isApprox()
template<class Derived >
template<class OtherDerived >
-
Returns
true
if *this
is approximately equal to other, within the precision determined by prec.
-
See also
- MatrixBase::isApprox()
norm()
normalize()
normalized()
operator!=()
template<class Derived >
template<class OtherDerived >
-
Returns
-
true if at least one pair of coefficients of
*this
and other are not exactly equal to each other.
-
Warning
-
When using floating point scalar values you probably should rather use a fuzzy comparison such as isApprox()
-
See also
- isApprox(), operator==
operator*()
template<class Derived >
template<class OtherDerived >
-
Returns
-
the concatenation of two rotations as a quaternion-quaternion product
operator*=()
template<class Derived >
template<class OtherDerived >
-
See also
-
operator*(Quaternion)
operator=() [1/2]
Set *this
from an angle-axis aa and returns a reference to *this
operator=() [2/2]
template<class Derived >
template<class MatrixDerived >
Set *this
from the expression xpr:
- if xpr is a 4x1 vector, then xpr is assumed to be a quaternion
- if xpr is a 3x3 matrix, then xpr is assumed to be rotation matrix and xpr is converted to a quaternion
operator==()
template<class Derived >
template<class OtherDerived >
-
Returns
-
true if each coefficients of
*this
and other are all exactly equal.
-
Warning
-
When using floating point scalar values you probably should rather use a fuzzy comparison such as isApprox()
-
See also
- isApprox(), operator!=
setFromTwoVectors()
template<class Derived >
template<typename Derived1 , typename Derived2 >
-
Returns
-
the quaternion which transform a into b through a rotation
Sets *this
to be 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
-
a reference to
*this
.
Note that the two input vectors do not have to be normalized, and do not need to have the same norm.
setIdentity()
slerp()
template<class Derived >
template<class OtherDerived >
-
Returns
-
the spherical linear interpolation between the two quaternions
*this
and other at the parameter t in [0;1].
This represents an interpolation for a constant motion between *this
and other, see also http://en.wikipedia.org/wiki/Slerp.
squaredNorm()
toRotationMatrix()
-
Returns
-
an equivalent 3x3 rotation matrix
Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.
vec() [1/2]
-
Returns
-
a vector expression of the imaginary part (x,y,z)
vec() [2/2]
-
Returns
-
a read-only vector expression of the imaginary part (x,y,z)
w() [1/2]
-
Returns
-
a reference to the
w
coefficient (if Derived is a non-const lvalue)
w() [2/2]
-
Returns
-
the
w
coefficient
x() [1/2]
-
Returns
-
a reference to the
x
coefficient (if Derived is a non-const lvalue)
x() [2/2]
-
Returns
-
the
x
coefficient
y() [1/2]
-
Returns
-
a reference to the
y
coefficient (if Derived is a non-const lvalue)
y() [2/2]
-
Returns
-
the
y
coefficient
z() [1/2]
-
Returns
-
a reference to the
z
coefficient (if Derived is a non-const lvalue)
z() [2/2]
-
Returns
-
the
z
coefficient
The documentation for this class was generated from the following file: