![]() |
Shapeworks Studio
2.1
Shape analysis software suite
|
The quaternion class used to represent 3D orientations and rotations. More...
#include <Quaternion.h>
Public Types | |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, 4, 1 > | Coefficients |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef AngleAxis< Scalar > | AngleAxisType |
typedef _Scalar | Scalar |
typedef internal::traits< Quaternion >::Coefficients | Coefficients |
typedef Base::AngleAxisType | AngleAxisType |
![]() | |
enum | |
typedef internal::traits< Quaternion< _Scalar, _Options > >::Scalar | Scalar |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef internal::traits< Quaternion< _Scalar, _Options > >::Coefficients | Coefficients |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef AngleAxis< Scalar > | AngleAxisType |
![]() | |
enum | |
enum | |
typedef ei_traits< Quaternion< _Scalar, _Options > >::Scalar | Scalar |
typedef internal::traits< Quaternion< _Scalar, _Options > >::Scalar | Scalar |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef Matrix< Scalar, Dim, 1 > | VectorType |
![]() | |
enum | |
enum | |
typedef ei_traits< Quaternion< _Scalar > >::Scalar | Scalar |
typedef internal::traits< Quaternion< _Scalar > >::Scalar | Scalar |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
typedef Matrix< Scalar, Dim, 1 > | VectorType |
Public Member Functions | |
Scalar | x () const |
Scalar | y () const |
Scalar | z () const |
Scalar | w () const |
Scalar & | x () |
Scalar & | y () |
Scalar & | z () |
Scalar & | w () |
const Block< const Coefficients, 3, 1 > | vec () const |
Block< Coefficients, 3, 1 > | vec () |
const Coefficients & | coeffs () const |
Coefficients & | coeffs () |
Quaternion () | |
Quaternion (Scalar w, Scalar x, Scalar y, Scalar z) | |
Quaternion (const Quaternion &other) | |
Quaternion (const AngleAxisType &aa) | |
template<typename Derived > | |
Quaternion (const MatrixBase< Derived > &other) | |
Quaternion & | operator= (const Quaternion &other) |
Quaternion & | operator= (const AngleAxisType &aa) |
template<typename Derived > | |
Quaternion & | operator= (const MatrixBase< Derived > &m) |
Quaternion & | setIdentity () |
Scalar | squaredNorm () const |
Scalar | norm () const |
void | normalize () |
Quaternion | normalized () const |
Scalar | eigen2_dot (const Quaternion &other) const |
Scalar | angularDistance (const Quaternion &other) const |
Matrix3 | toRotationMatrix (void) const |
template<typename Derived1 , typename Derived2 > | |
Quaternion & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
Quaternion | operator* (const Quaternion &q) const |
Quaternion & | operator*= (const Quaternion &q) |
Quaternion | inverse (void) const |
Quaternion | conjugate (void) const |
Quaternion | slerp (Scalar t, const Quaternion &other) const |
template<typename Derived > | |
Vector3 | operator* (const MatrixBase< Derived > &vec) const |
template<typename NewScalarType > | |
internal::cast_return_type< Quaternion, Quaternion< NewScalarType > >::type | cast () const |
template<typename OtherScalarType > | |
Quaternion (const Quaternion< OtherScalarType > &other) | |
bool | isApprox (const Quaternion &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const |
Quaternion () | |
Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) | |
Quaternion (const Scalar *data) | |
template<class Derived > | |
EIGEN_STRONG_INLINE | 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) | |
Coefficients & | coeffs () |
const Coefficients & | coeffs () const |
template<typename Derived > | |
Quaternion< Scalar > & | operator= (const MatrixBase< Derived > &xpr) |
template<typename Derived1 , typename Derived2 > | |
Quaternion< Scalar > & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
template<typename Derived1 , typename Derived2 > | |
Quaternion< Scalar, Options > | FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
![]() | |
Scalar | x () const |
Scalar & | x () |
Scalar | y () const |
Scalar & | y () |
Scalar | z () const |
Scalar & | z () |
Scalar | w () const |
Scalar & | w () |
const VectorBlock< const Coefficients, 3 > | vec () const |
VectorBlock< Coefficients, 3 > | vec () |
const internal::traits< Quaternion< _Scalar, _Options > >::Coefficients & | coeffs () const |
internal::traits< Quaternion< _Scalar, _Options > >::Coefficients & | coeffs () |
EIGEN_STRONG_INLINE QuaternionBase< Quaternion< _Scalar, _Options > > & | operator= (const QuaternionBase< Quaternion< _Scalar, _Options > > &other) |
EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & | operator= (const QuaternionBase< OtherDerived > &other) |
Quaternion< _Scalar, _Options > & | operator= (const AngleAxisType &aa) |
Quaternion< _Scalar, _Options > & | operator= (const MatrixBase< OtherDerived > &m) |
QuaternionBase & | setIdentity () |
Scalar | squaredNorm () const |
Scalar | norm () const |
void | normalize () |
Quaternion< Scalar > | normalized () const |
Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
Matrix3 | toRotationMatrix () const |
Quaternion< _Scalar, _Options > & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
EIGEN_STRONG_INLINE Quaternion< Scalar > | operator* (const QuaternionBase< OtherDerived > &q) const |
EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & | operator*= (const QuaternionBase< OtherDerived > &q) |
Quaternion< Scalar > | inverse () const |
Quaternion< Scalar > | conjugate () const |
Quaternion< Scalar > | slerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const |
bool | isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
EIGEN_STRONG_INLINE Vector3 | _transformVector (Vector3 v) const |
internal::cast_return_type< Quaternion< _Scalar, _Options >, Quaternion< NewScalarType > >::type | cast () const |
![]() | |
const Quaternion< _Scalar, _Options > & | derived () const |
Quaternion< _Scalar, _Options > & | derived () |
const Quaternion< _Scalar, _Options > & | derived () const |
Quaternion< _Scalar, _Options > & | derived () |
RotationMatrixType | toRotationMatrix () const |
RotationMatrixType | toRotationMatrix () const |
Quaternion< _Scalar, _Options > | inverse () const |
Quaternion< _Scalar, _Options > | inverse () const |
Transform< Scalar, Dim > | operator* (const Translation< Scalar, Dim > &t) const |
RotationMatrixType | operator* (const Scaling< Scalar, Dim > &s) const |
Transform< Scalar, Dim > | operator* (const Transform< Scalar, Dim > &t) const |
Transform< Scalar, Dim, Isometry > | operator* (const Translation< Scalar, Dim > &t) const |
RotationMatrixType | operator* (const UniformScaling< Scalar > &s) const |
EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Quaternion< _Scalar, _Options >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
RotationMatrixType | matrix () const |
VectorType | _transformVector (const OtherVectorType &v) const |
![]() | |
const Quaternion< _Scalar > & | derived () const |
Quaternion< _Scalar > & | derived () |
const Quaternion< _Scalar > & | derived () const |
Quaternion< _Scalar > & | derived () |
RotationMatrixType | toRotationMatrix () const |
RotationMatrixType | toRotationMatrix () const |
Quaternion< _Scalar > | inverse () const |
Quaternion< _Scalar > | inverse () const |
Transform< Scalar, Dim > | operator* (const Translation< Scalar, Dim > &t) const |
RotationMatrixType | operator* (const Scaling< Scalar, Dim > &s) const |
Transform< Scalar, Dim > | operator* (const Transform< Scalar, Dim > &t) const |
Transform< Scalar, Dim, Isometry > | operator* (const Translation< Scalar, Dim > &t) const |
RotationMatrixType | operator* (const UniformScaling< Scalar > &s) const |
EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Quaternion< _Scalar >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
RotationMatrixType | matrix () const |
VectorType | _transformVector (const OtherVectorType &v) const |
Static Public Member Functions | |
static Quaternion | Identity () |
template<typename Derived1 , typename Derived2 > | |
static Quaternion | FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
![]() | |
static Quaternion< Scalar > | Identity () |
Static Protected Member Functions | |
static EIGEN_STRONG_INLINE void | _check_template_params () |
Protected Attributes | |
Coefficients | m_coeffs |
The quaternion class used to represent 3D orientations and rotations.
_Scalar | the scalar type, i.e., the type of the coefficients |
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, quatertions offer the following advantages:
The following two typedefs are provided for convenience:
Quaternionf
for float
Quaterniond
for double
_Scalar | the scalar type, i.e., the type of the coefficients |
_Options | controls the memory alignement of the coeffecients. 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, quatertions offer the following advantages:
The following two typedefs are provided for convenience:
Quaternionf
for float
Quaterniond
for double
Definition at line 47 of file Quaternion.h.
typedef AngleAxis<Scalar> Eigen::Quaternion< _Scalar >::AngleAxisType |
the equivalent angle-axis type
Definition at line 66 of file Quaternion.h.
typedef Matrix<Scalar, 4, 1> Eigen::Quaternion< _Scalar >::Coefficients |
the type of the Coefficients 4-vector
Definition at line 60 of file Quaternion.h.
typedef Matrix<Scalar,3,3> Eigen::Quaternion< _Scalar >::Matrix3 |
the equivalent rotation matrix type
Definition at line 64 of file Quaternion.h.
typedef _Scalar Eigen::Quaternion< _Scalar >::Scalar |
the scalar type of the coefficients
Definition at line 57 of file Quaternion.h.
typedef Matrix<Scalar,3,1> Eigen::Quaternion< _Scalar >::Vector3 |
the type of a 3D vector
Definition at line 62 of file Quaternion.h.
|
inline |
Default constructor leaving the quaternion uninitialized.
Definition at line 99 of file Quaternion.h.
|
inline |
Constructs and initializes the quaternion from its four coefficients w, x, y and z.
x
, y
, z
, w
] Definition at line 108 of file Quaternion.h.
|
inline |
|
inlineexplicit |
Constructs and initializes a quaternion from the angle-axis aa
Definition at line 115 of file Quaternion.h.
|
inlineexplicit |
Constructs and initializes a quaternion from either:
Definition at line 123 of file Quaternion.h.
|
inlineexplicit |
Copy constructor with scalar type conversion
Definition at line 192 of file Quaternion.h.
|
inline |
Default constructor leaving the quaternion uninitialized.
Definition at line 243 of file Quaternion.h.
|
inline |
Constructs and initializes the quaternion from its four coefficients w, x, y and z.
x
, y
, z
, w
] Definition at line 252 of file Quaternion.h.
|
inline |
Constructs and initialize a quaternion from the array data
Definition at line 255 of file Quaternion.h.
|
inline |
|
inlineexplicit |
Constructs and initializes a quaternion from the angle-axis aa
Definition at line 261 of file Quaternion.h.
|
inlineexplicit |
Constructs and initializes a quaternion from either:
Definition at line 268 of file Quaternion.h.
|
inlineexplicit |
Explicit copy constructor with scalar conversion
Definition at line 272 of file Quaternion.h.
|
inline |
Definition at line 404 of file Quaternion.h.
|
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 187 of file Quaternion.h.
|
inline |
Definition at line 93 of file Quaternion.h.
|
inline |
Definition at line 96 of file Quaternion.h.
|
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 395 of file Quaternion.h.
|
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 161 of file Quaternion.h.
Quaternion<Scalar,Options> Eigen::Quaternion< _Scalar >::FromTwoVectors | ( | const MatrixBase< Derived1 > & | a, |
const MatrixBase< Derived2 > & | b | ||
) |
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.
Definition at line 623 of file Quaternion.h.
|
inlinestatic |
Definition at line 133 of file Quaternion.h.
|
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.Definition at line 375 of file Quaternion.h.
|
inline |
true
if *this
is approximately equal to other, within the precision determined by prec.Definition at line 199 of file Quaternion.h.
|
inline |
Definition at line 147 of file Quaternion.h.
|
inline |
Normalizes the quaternion *this
Definition at line 151 of file Quaternion.h.
|
inline |
*this
Definition at line 154 of file Quaternion.h.
|
inline |
Definition at line 228 of file Quaternion.h.
|
inline |
Rotation of a vector by a quaternion.
Definition at line 250 of file Quaternion.h.
|
inline |
Definition at line 235 of file Quaternion.h.
|
inline |
Set *this
from an angle-axis aa and returns a reference to *this
Definition at line 272 of file Quaternion.h.
|
inline |
Set *this
from the expression xpr:
Definition at line 287 of file Quaternion.h.
|
inline |
Sets *this to be a quaternion representing a rotation sending the vector a to the vector b.
Note that the two input vectors do not have to be normalized.
Definition at line 338 of file Quaternion.h.
|
inline |
Definition at line 137 of file Quaternion.h.
Quaternion< Scalar > Eigen::Quaternion< Scalar >::slerp | ( | Scalar | t, |
const Quaternion< _Scalar > & | other | ||
) | const |
*this
and other at the parameter t Definition at line 416 of file Quaternion.h.
|
inline |
Definition at line 142 of file Quaternion.h.
|
inline |
|
inline |
Definition at line 87 of file Quaternion.h.
|
inline |
Definition at line 90 of file Quaternion.h.
|
inline |
w
coefficient Definition at line 75 of file Quaternion.h.
|
inline |
w
coefficient Definition at line 84 of file Quaternion.h.
|
inline |
x
coefficient Definition at line 69 of file Quaternion.h.
|
inline |
x
coefficient Definition at line 78 of file Quaternion.h.
|
inline |
y
coefficient Definition at line 71 of file Quaternion.h.
|
inline |
y
coefficient Definition at line 80 of file Quaternion.h.
|
inline |
z
coefficient Definition at line 73 of file Quaternion.h.
|
inline |
z
coefficient Definition at line 82 of file Quaternion.h.