Definition at line 42 of file Quaternion.h.
#include <src/Geometry/Quaternion.h>
Public Types | |
typedef internal::traits < Derived >::Scalar | Scalar |
the scalar type of the coefficients | |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef internal::traits < Derived >::Coefficients | Coefficients |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
the type of a 3D vector | |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
the equivalent rotation matrix type | |
typedef AngleAxis< Scalar > | AngleAxisType |
the equivalent angle-axis type | |
Public Member Functions | |
Scalar | x () const |
Scalar | y () const |
Scalar | z () const |
Scalar | w () const |
Scalar & | x () |
Scalar & | y () |
Scalar & | z () |
Scalar & | w () |
const VectorBlock< const Coefficients, 3 > | vec () const |
VectorBlock< Coefficients, 3 > | vec () |
const internal::traits < Derived >::Coefficients & | coeffs () const |
internal::traits< Derived > ::Coefficients & | coeffs () |
EIGEN_STRONG_INLINE QuaternionBase< Derived > & | operator= (const QuaternionBase< Derived > &other) |
template<class OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | operator= (const QuaternionBase< OtherDerived > &other) |
Derived & | operator= (const AngleAxisType &aa) |
Set *this from an angle-axis aa and returns a reference to *this . | |
template<class OtherDerived > | |
Derived & | operator= (const MatrixBase< OtherDerived > &m) |
QuaternionBase & | setIdentity () |
Scalar | squaredNorm () const |
Scalar | norm () const |
void | normalize () |
Normalizes the quaternion *this . | |
Quaternion< Scalar > | normalized () const |
template<class OtherDerived > | |
Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
template<class OtherDerived > | |
Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
Matrix3 | toRotationMatrix () const |
Convert the quaternion to a 3x3 rotation matrix. | |
template<typename Derived1 , typename Derived2 > | |
Derived & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b. | |
template<class OtherDerived > | |
EIGEN_STRONG_INLINE Quaternion < Scalar > | operator* (const QuaternionBase< OtherDerived > &q) const |
template<class OtherDerived > | |
EIGEN_STRONG_INLINE Derived & | operator*= (const QuaternionBase< OtherDerived > &q) |
Quaternion< Scalar > | inverse () const |
Quaternion< Scalar > | conjugate () const |
template<class OtherDerived > | |
Quaternion< Scalar > | slerp (Scalar t, const QuaternionBase< OtherDerived > &other) const |
template<class OtherDerived > | |
bool | isApprox (const QuaternionBase< OtherDerived > &other, RealScalar prec=NumTraits< Scalar >::dummy_precision()) const |
EIGEN_STRONG_INLINE Vector3 | _transformVector (Vector3 v) const |
return the result vector of v through the rotation | |
template<typename NewScalarType > | |
internal::cast_return_type < Derived, Quaternion < NewScalarType > >::type | cast () const |
template<class MatrixDerived > | |
Derived & | operator= (const MatrixBase< MatrixDerived > &xpr) |
Set *this from the expression xpr:
| |
Static Public Member Functions | |
static Quaternion< Scalar > | Identity () |
Private Types | |
typedef RotationBase< Derived, 3 > | Base |
typedef AngleAxis<Scalar> QuaternionBase< Derived >::AngleAxisType |
the equivalent angle-axis type
Reimplemented in Quaternion< _Scalar >.
Definition at line 59 of file Quaternion.h.
typedef RotationBase<Derived, 3> QuaternionBase< Derived >::Base [private] |
Reimplemented in Quaternion< _Scalar >, Map< const Quaternion< _Scalar >, PacketAccess >, and Map< Quaternion< _Scalar >, PacketAccess >.
Definition at line 44 of file Quaternion.h.
typedef internal::traits<Derived>::Coefficients QuaternionBase< Derived >::Coefficients |
Reimplemented in Quaternion< _Scalar >, Map< const Quaternion< _Scalar >, PacketAccess >, and Map< Quaternion< _Scalar >, PacketAccess >.
Definition at line 51 of file Quaternion.h.
typedef Matrix<Scalar,3,3> QuaternionBase< Derived >::Matrix3 |
the equivalent rotation matrix type
Definition at line 57 of file Quaternion.h.
typedef NumTraits<Scalar>::Real QuaternionBase< Derived >::RealScalar |
Definition at line 50 of file Quaternion.h.
typedef internal::traits<Derived>::Scalar QuaternionBase< Derived >::Scalar |
the scalar type of the coefficients
Reimplemented from RotationBase< Derived, 3 >.
Reimplemented in Quaternion< _Scalar >, Map< const Quaternion< _Scalar >, PacketAccess >, and Map< Quaternion< _Scalar >, PacketAccess >.
Definition at line 49 of file Quaternion.h.
typedef Matrix<Scalar,3,1> QuaternionBase< Derived >::Vector3 |
the type of a 3D vector
Definition at line 55 of file Quaternion.h.
EIGEN_STRONG_INLINE QuaternionBase< Derived >::Vector3 QuaternionBase< Derived >::_transformVector | ( | Vector3 | v | ) | const |
return the result vector of v through the rotation
Rotation of a vector by a quaternion.
Definition at line 439 of file Quaternion.h.
internal::traits< Derived >::Scalar QuaternionBase< Derived >::angularDistance | ( | const QuaternionBase< OtherDerived > & | other | ) | const [inline] |
Definition at line 618 of file Quaternion.h.
References abs().
internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type QuaternionBase< Derived >::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
.
Definition at line 180 of file Quaternion.h.
const internal::traits<Derived>::Coefficients& QuaternionBase< Derived >::coeffs | ( | ) | const [inline] |
Reimplemented in Quaternion< _Scalar >, Map< const Quaternion< _Scalar >, PacketAccess >, and Map< Quaternion< _Scalar >, PacketAccess >.
Definition at line 88 of file Quaternion.h.
Referenced by QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::cast(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::dot(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::isApprox(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::norm(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::normalize(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::normalized(), QuaternionBase< Derived >::operator=(), internal::quaternionbase_assign_impl< Other, 4, 1 >::run(), internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), internal::quat_product< Architecture::SSE, Derived, OtherDerived, double, Aligned >::run(), internal::quat_product< Architecture::SSE, Derived, OtherDerived, float, Aligned >::run(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::setIdentity(), QuaternionBase< Derived >::slerp(), QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::squaredNorm(), and QuaternionBase< Map< Quaternion< _Scalar >, PacketAccess > >::vec().
internal::traits<Derived>::Coefficients& QuaternionBase< Derived >::coeffs | ( | ) | [inline] |
Reimplemented in Quaternion< _Scalar >, and Map< Quaternion< _Scalar >, PacketAccess >.
Definition at line 91 of file Quaternion.h.
Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::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.Definition at line 607 of file Quaternion.h.
References internal::y.
Scalar QuaternionBase< Derived >::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. Definition at line 137 of file Quaternion.h.
static Quaternion<Scalar> QuaternionBase< Derived >::Identity | ( | ) | [inline, static] |
Definition at line 109 of file Quaternion.h.
Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::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 >.
Definition at line 586 of file Quaternion.h.
References conjugate().
bool QuaternionBase< Derived >::isApprox | ( | const QuaternionBase< OtherDerived > & | other, |
RealScalar | prec = NumTraits<Scalar>::dummy_precision() |
||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Definition at line 168 of file Quaternion.h.
Scalar QuaternionBase< Derived >::norm | ( | ) | const [inline] |
Definition at line 123 of file Quaternion.h.
void QuaternionBase< Derived >::normalize | ( | void | ) | [inline] |
Normalizes the quaternion *this
.
Definition at line 127 of file Quaternion.h.
Quaternion<Scalar> QuaternionBase< Derived >::normalized | ( | ) | const [inline] |
*this
Definition at line 130 of file Quaternion.h.
EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::operator* | ( | const QuaternionBase< OtherDerived > & | other | ) | const |
Definition at line 412 of file Quaternion.h.
References EIGEN_STATIC_ASSERT, and Architecture::Target.
EIGEN_STRONG_INLINE Derived & QuaternionBase< Derived >::operator*= | ( | const QuaternionBase< OtherDerived > & | other | ) |
Definition at line 424 of file Quaternion.h.
References RotationBase< Derived, 3 >::derived().
Derived& QuaternionBase< Derived >::operator= | ( | const MatrixBase< OtherDerived > & | m | ) |
Derived& QuaternionBase< Derived >::operator= | ( | const MatrixBase< MatrixDerived > & | xpr | ) | [inline] |
Set *this
from the expression xpr:
Definition at line 485 of file Quaternion.h.
References EIGEN_STATIC_ASSERT.
EIGEN_STRONG_INLINE QuaternionBase< Derived > & QuaternionBase< Derived >::operator= | ( | const QuaternionBase< Derived > & | other | ) |
Definition at line 452 of file Quaternion.h.
References QuaternionBase< Derived >::coeffs().
EIGEN_STRONG_INLINE Derived & QuaternionBase< Derived >::operator= | ( | const QuaternionBase< OtherDerived > & | other | ) |
Definition at line 460 of file Quaternion.h.
References QuaternionBase< Derived >::coeffs().
EIGEN_STRONG_INLINE Derived & QuaternionBase< Derived >::operator= | ( | const AngleAxisType & | aa | ) |
Set *this
from an angle-axis aa and returns a reference to *this
.
Definition at line 469 of file Quaternion.h.
References AngleAxis< _Scalar >::angle(), AngleAxis< _Scalar >::axis(), cos(), and sin().
Derived & QuaternionBase< 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.
Definition at line 544 of file Quaternion.h.
References ComputeFullV, JacobiSVD< _MatrixType, QRPreconditioner >::matrixV(), MatrixBase< Derived >::normalized(), and internal::sqrt().
QuaternionBase& QuaternionBase< Derived >::setIdentity | ( | ) | [inline] |
Definition at line 113 of file Quaternion.h.
Quaternion< typename internal::traits< Derived >::Scalar > QuaternionBase< Derived >::slerp | ( | Scalar | t, |
const QuaternionBase< OtherDerived > & | other | ||
) | const |
*this
t in [0;1] see http://en.wikipedia.org/wiki/Slerp*this
and other at the parameter t Definition at line 632 of file Quaternion.h.
References abs(), QuaternionBase< Derived >::coeffs(), sin(), and t().
Scalar QuaternionBase< Derived >::squaredNorm | ( | ) | const [inline] |
Definition at line 118 of file Quaternion.h.
QuaternionBase< Derived >::Matrix3 QuaternionBase< Derived >::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 >.
Definition at line 498 of file Quaternion.h.
References PlainObjectBase< Derived >::coeffRef(), and internal::y.
const VectorBlock<const Coefficients,3> QuaternionBase< Derived >::vec | ( | ) | const [inline] |
Definition at line 82 of file Quaternion.h.
Referenced by AngleAxis< _Scalar >::operator=().
VectorBlock<Coefficients,3> QuaternionBase< Derived >::vec | ( | ) | [inline] |
Definition at line 85 of file Quaternion.h.
Scalar& QuaternionBase< Derived >::w | ( | ) | [inline] |
w
coefficient Definition at line 79 of file Quaternion.h.
Scalar QuaternionBase< Derived >::w | ( | ) | const [inline] |
w
coefficient Definition at line 70 of file Quaternion.h.
Referenced by AngleAxis< _Scalar >::operator=(), internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), and internal::quat_product< Arch, Derived1, Derived2, Scalar, PacketAccess >::run().
Scalar QuaternionBase< Derived >::x | ( | ) | const [inline] |
x
coefficient Definition at line 64 of file Quaternion.h.
Referenced by internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), and internal::quat_product< Arch, Derived1, Derived2, Scalar, PacketAccess >::run().
Scalar& QuaternionBase< Derived >::x | ( | ) | [inline] |
x
coefficient Definition at line 73 of file Quaternion.h.
Scalar QuaternionBase< Derived >::y | ( | ) | const [inline] |
y
coefficient Definition at line 66 of file Quaternion.h.
Referenced by internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), and internal::quat_product< Arch, Derived1, Derived2, Scalar, PacketAccess >::run().
Scalar& QuaternionBase< Derived >::y | ( | ) | [inline] |
y
coefficient Definition at line 75 of file Quaternion.h.
Scalar QuaternionBase< Derived >::z | ( | ) | const [inline] |
z
coefficient Definition at line 68 of file Quaternion.h.
Referenced by internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), and internal::quat_product< Arch, Derived1, Derived2, Scalar, PacketAccess >::run().
Scalar& QuaternionBase< Derived >::z | ( | ) | [inline] |
z
coefficient Definition at line 77 of file Quaternion.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011 |