Medial Code Documentation
|
\geometry_module More...
#include <Quaternion.h>
Public Types | |
enum | |
typedef QuaternionBase< Quaternion< _Scalar, _Options > > | Base |
typedef _Scalar | Scalar |
typedef internal::traits< Quaternion >::Coefficients | Coefficients |
typedef Base::AngleAxisType | AngleAxisType |
![]() | |
enum | |
typedef RotationBase< Quaternion< _Scalar, _Options >, 3 > | Base |
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 |
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 | |
![]() | |
enum | { Dim = _Dim } |
typedef internal::traits< Derived >::Scalar | Scalar |
the scalar type of the coefficients | |
typedef Matrix< Scalar, Dim, Dim > | RotationMatrixType |
corresponding linear transformation matrix type | |
typedef Matrix< Scalar, Dim, 1 > | VectorType |
Public Member Functions | |
Quaternion () | |
Default constructor leaving the quaternion uninitialized. | |
Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) | |
Constructs and initializes the quaternion ![]() | |
Quaternion (const Scalar *data) | |
Constructs and initialize a quaternion from the array data. | |
template<class Derived > | |
EIGEN_STRONG_INLINE | Quaternion (const QuaternionBase< Derived > &other) |
Copy constructor. | |
Quaternion (const AngleAxisType &aa) | |
Constructs and initializes a quaternion from the angle-axis aa. | |
template<typename Derived > | |
Quaternion (const MatrixBase< Derived > &other) | |
Constructs and initializes a quaternion from either: | |
template<typename OtherScalar , int OtherOptions> | |
Quaternion (const Quaternion< OtherScalar, OtherOptions > &other) | |
Explicit copy constructor with scalar conversion. | |
Coefficients & | coeffs () |
const Coefficients & | coeffs () const |
template<typename Derived1 , typename Derived2 > | |
Quaternion< Scalar, Options > | FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
Returns a quaternion representing a rotation between the two arbitrary vectors a and 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) |
Set *this from an angle-axis aa and returns a reference to *this . | |
Quaternion< _Scalar, _Options > & | operator= (const MatrixBase< OtherDerived > &m) |
Quaternion< _Scalar, _Options > & | operator= (const MatrixBase< MatrixDerived > &xpr) |
Set *this from the expression xpr: | |
QuaternionBase & | setIdentity () |
Scalar | squaredNorm () const |
Scalar | norm () const |
void | normalize () |
Normalizes the quaternion *this . | |
Quaternion< Scalar > | normalized () const |
Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
internal::traits< Quaternion< _Scalar, _Options > >::Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
Matrix3 | toRotationMatrix () const |
Convert the quaternion to a 3x3 rotation matrix. | |
Quaternion< _Scalar, _Options > & | 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. | |
EIGEN_STRONG_INLINE Quaternion< Scalar > | operator* (const QuaternionBase< OtherDerived > &q) const |
EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > | operator* (const QuaternionBase< OtherDerived > &other) 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 |
Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::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 (const Vector3 &v) const |
return the result vector of v through the rotation | |
internal::cast_return_type< Quaternion< _Scalar, _Options >, Quaternion< NewScalarType > >::type | cast () const |
![]() | |
const Derived & | derived () const |
Derived & | derived () |
RotationMatrixType | toRotationMatrix () const |
RotationMatrixType | matrix () const |
Derived | inverse () const |
Transform< Scalar, Dim, Isometry > | operator* (const Translation< Scalar, Dim > &t) const |
RotationMatrixType | operator* (const UniformScaling< Scalar > &s) const |
template<typename OtherDerived > | |
EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType | operator* (const EigenBase< OtherDerived > &e) const |
template<int Mode, int Options> | |
Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
template<typename OtherVectorType > | |
VectorType | _transformVector (const OtherVectorType &v) const |
Static Public Member Functions | |
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 |
\geometry_module
The quaternion class used to represent 3D orientations and rotations
_Scalar | the scalar type, i.e., the type of the coefficients |
_Options | controls the memory alignment of the coefficients. Can be # AutoAlign or # DontAlign. Default is AutoAlign. |
This class represents a quaternion
The following two typedefs are provided for convenience:
Quaternionf
for float
Quaterniond
for double
|
inline |
Constructs and initializes the quaternion
x
, y
, z
, w
]
|
inlineexplicit |
Constructs and initializes a quaternion from either:
Quaternion< Scalar, Options > Eigen::Quaternion< _Scalar, _Options >::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.