$treeview $search $mathjax
Eigen
3.2.5
$projectbrief
|
$projectbrief
|
$searchbox |
Base class for quaternion expressions. More...
Public Types | |
typedef AngleAxis< Scalar > | AngleAxisType |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef internal::traits < Derived >::Scalar | Scalar |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
Public Member Functions | |
Vector3 | _transformVector (const Vector3 &v) const |
template<class OtherDerived > | |
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 |
RotationMatrixType | matrix () const |
Scalar | norm () const |
void | normalize () |
Quaternion< Scalar > | normalized () const |
Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
internal::rotation_base_generic_product_selector < Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime > ::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
RotationMatrixType | operator* (const UniformScaling< Scalar > &s) const |
Transform< Scalar, Dim, Isometry > | operator* (const Translation< Scalar, Dim > &t) const |
template<class OtherDerived > | |
Quaternion< Scalar > | operator* (const QuaternionBase< OtherDerived > &q) const |
template<class OtherDerived > | |
Derived & | operator*= (const QuaternionBase< OtherDerived > &q) |
template<class MatrixDerived > | |
Derived & | operator= (const MatrixBase< MatrixDerived > &xpr) |
Derived & | operator= (const AngleAxisType &aa) |
template<typename Derived1 , typename Derived2 > | |
Derived & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
QuaternionBase & | setIdentity () |
template<class OtherDerived > | |
Quaternion< 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 |
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< Scalar > | Identity () |
Friends | |
Transform< Scalar, Dim, Affine > | operator* (const DiagonalMatrix< Scalar, Dim > &l, const Derived &r) |
RotationMatrixType | operator* (const EigenBase< OtherDerived > &l, const Derived &r) |
Base class for quaternion expressions.
This is defined in the Geometry module.
#include <Eigen/Geometry>
Derived | derived type (CRTP) |
typedef AngleAxis<Scalar> AngleAxisType |
the equivalent angle-axis type
Reimplemented in Quaternion< _Scalar, _Options >.
typedef Matrix<Scalar,Dim,Dim> RotationMatrixType [inherited] |
corresponding linear transformation matrix type
the scalar type of the coefficients
Reimplemented from RotationBase< Derived, 3 >.
Reimplemented in Quaternion< _Scalar, _Options >, Map< const Quaternion< _Scalar >, _Options >, and Map< Quaternion< _Scalar >, _Options >.
QuaternionBase< Derived >::Vector3 _transformVector | ( | const Vector3 & | v | ) | const [inline] |
return the result vector of v through the rotation
Rotation of a vector by a quaternion.
References QuaternionBase< Derived >::vec(), and QuaternionBase< Derived >::w().
internal::traits< Derived >::Scalar angularDistance | ( | const QuaternionBase< OtherDerived > & | other | ) | const [inline] |
References QuaternionBase< Derived >::conjugate(), QuaternionBase< Quaternion< _Scalar, _Options > >::vec(), and QuaternionBase< Quaternion< _Scalar, _Options > >::w().
internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type cast | ( | ) | const [inline] |
*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
.
internal::traits<Derived>::Coefficients& coeffs | ( | ) | [inline] |
Reimplemented in Quaternion< _Scalar, _Options >, and Map< Quaternion< _Scalar >, _Options >.
const internal::traits<Derived>::Coefficients& coeffs | ( | ) | const [inline] |
Reimplemented in Quaternion< _Scalar, _Options >, Map< const Quaternion< _Scalar >, _Options >, and Map< Quaternion< _Scalar >, _Options >.
Referenced by QuaternionBase< Quaternion< _Scalar, _Options > >::dot(), QuaternionBase< Quaternion< _Scalar, _Options > >::isApprox(), QuaternionBase< Quaternion< _Scalar, _Options > >::norm(), QuaternionBase< Quaternion< _Scalar, _Options > >::normalize(), QuaternionBase< Quaternion< _Scalar, _Options > >::normalized(), QuaternionBase< Quaternion< _Scalar, _Options > >::setIdentity(), QuaternionBase< Derived >::slerp(), QuaternionBase< Quaternion< _Scalar, _Options > >::squaredNorm(), and QuaternionBase< Quaternion< _Scalar, _Options > >::vec().
Quaternion< typename internal::traits< Derived >::Scalar > conjugate | ( | ) | const [inline] |
*this
which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.References QuaternionBase< Derived >::w(), QuaternionBase< Derived >::x(), QuaternionBase< Derived >::y(), and QuaternionBase< Derived >::z().
Referenced by QuaternionBase< Derived >::angularDistance(), and QuaternionBase< Derived >::inverse().
Scalar dot | ( | const QuaternionBase< OtherDerived > & | 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. Referenced by QuaternionBase< Derived >::slerp().
static Quaternion<Scalar> Identity | ( | ) | [inline, static] |
Quaternion< typename internal::traits< Derived >::Scalar > inverse | ( | ) | 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< Derived, 3 >.
References QuaternionBase< Derived >::conjugate(), and QuaternionBase< Derived >::squaredNorm().
bool isApprox | ( | const QuaternionBase< OtherDerived > & | other, | |
const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() | |||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.RotationMatrixType matrix | ( | ) | const [inline, inherited] |
Scalar norm | ( | ) | const [inline] |
void normalize | ( | void | ) | [inline] |
Normalizes the quaternion *this
Quaternion<Scalar> normalized | ( | ) | const [inline] |
*this
Transform<Scalar,Dim,Mode> operator* | ( | const Transform< Scalar, Dim, Mode, Options > & | t | ) | const [inline, inherited] |
*this
with a transformation t References RotationBase< Derived, _Dim >::toRotationMatrix().
internal::rotation_base_generic_product_selector<Derived ,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType operator* | ( | const EigenBase< OtherDerived > & | e | ) | const [inline, inherited] |
*this
with a generic expression e e can be:References EigenBase< Derived >::derived().
RotationMatrixType operator* | ( | const UniformScaling< Scalar > & | s | ) | const [inline, inherited] |
*this
with a uniform scaling s References RotationBase< Derived, _Dim >::toRotationMatrix().
Transform<Scalar,Dim,Isometry> operator* | ( | const Translation< Scalar, Dim > & | t | ) | const [inline, inherited] |
*this
with a translation t Quaternion< typename internal::traits< Derived >::Scalar > operator* | ( | const QuaternionBase< OtherDerived > & | other | ) | const [inline] |
Derived & operator*= | ( | const QuaternionBase< OtherDerived > & | other | ) | [inline] |
Derived& operator= | ( | const MatrixBase< MatrixDerived > & | xpr | ) | [inline] |
Set *this
from the expression xpr:
Derived & operator= | ( | const AngleAxisType & | aa | ) | [inline] |
Set *this
from an angle-axis aa and returns a reference to *this
References QuaternionBase< Derived >::vec(), and QuaternionBase< Derived >::w().
Derived & setFromTwoVectors | ( | const MatrixBase< Derived1 > & | a, | |
const MatrixBase< Derived2 > & | b | |||
) | [inline] |
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.
*this
.Note that the two input vectors do not have to be normalized, and do not need to have the same norm.
References Eigen::ComputeFullV, JacobiSVD< _MatrixType, QRPreconditioner >::matrixV(), MatrixBase< Derived >::normalized(), QuaternionBase< Derived >::vec(), and QuaternionBase< Derived >::w().
Referenced by Quaternion< _Scalar, _Options >::FromTwoVectors().
QuaternionBase& setIdentity | ( | ) | [inline] |
Quaternion< typename internal::traits< Derived >::Scalar > slerp | ( | const Scalar & | t, | |
const QuaternionBase< OtherDerived > & | other | |||
) | const [inline] |
*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.
References QuaternionBase< Derived >::coeffs(), and QuaternionBase< Derived >::dot().
Scalar squaredNorm | ( | ) | const [inline] |
Referenced by QuaternionBase< Derived >::inverse().
QuaternionBase< Derived >::Matrix3 toRotationMatrix | ( | void | ) | const [inline] |
Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.
Reimplemented from RotationBase< Derived, 3 >.
References QuaternionBase< Derived >::w(), QuaternionBase< Derived >::x(), QuaternionBase< Derived >::y(), and QuaternionBase< Derived >::z().
VectorBlock<Coefficients,3> vec | ( | ) | [inline] |
const VectorBlock<const Coefficients,3> vec | ( | ) | const [inline] |
Referenced by QuaternionBase< Derived >::_transformVector(), QuaternionBase< Derived >::operator=(), AngleAxis< _Scalar >::operator=(), and QuaternionBase< Derived >::setFromTwoVectors().
Scalar& w | ( | ) | [inline] |
w
coefficient Scalar w | ( | ) | const [inline] |
w
coefficient Referenced by QuaternionBase< Derived >::_transformVector(), QuaternionBase< Derived >::conjugate(), QuaternionBase< Derived >::operator=(), AngleAxis< _Scalar >::operator=(), QuaternionBase< Derived >::setFromTwoVectors(), and QuaternionBase< Derived >::toRotationMatrix().
Scalar& x | ( | ) | [inline] |
x
coefficient Scalar x | ( | ) | const [inline] |
x
coefficient Referenced by QuaternionBase< Derived >::conjugate(), and QuaternionBase< Derived >::toRotationMatrix().
Scalar& y | ( | ) | [inline] |
y
coefficient Scalar y | ( | ) | const [inline] |
y
coefficient Referenced by QuaternionBase< Derived >::conjugate(), and QuaternionBase< Derived >::toRotationMatrix().
Scalar& z | ( | ) | [inline] |
z
coefficient Scalar z | ( | ) | const [inline] |
z
coefficient Referenced by QuaternionBase< Derived >::conjugate(), and QuaternionBase< Derived >::toRotationMatrix().
Transform<Scalar,Dim,Affine> operator* | ( | const DiagonalMatrix< Scalar, Dim > & | l, | |
const Derived & | r | |||
) | [friend, inherited] |
RotationMatrixType operator* | ( | const EigenBase< OtherDerived > & | l, | |
const Derived & | r | |||
) | [friend, inherited] |