Represents a 3D rotation as a rotation angle around an arbitrary 3D axis. More...
#include <AngleAxis.h>
Public Types | |
enum | { Dim = 3 } |
enum | { Dim = 3 } |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
typedef Quaternion< Scalar > | QuaternionType |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
typedef Quaternion< Scalar > | QuaternionType |
Public Member Functions | |
AngleAxis () | |
template<typename Derived > | |
AngleAxis (Scalar angle, const MatrixBase< Derived > &axis) | |
AngleAxis (const QuaternionType &q) | |
template<typename Derived > | |
AngleAxis (const MatrixBase< Derived > &m) | |
Scalar | angle () const |
Scalar & | angle () |
const Vector3 & | axis () const |
Vector3 & | axis () |
QuaternionType | operator* (const AngleAxis &other) const |
QuaternionType | operator* (const QuaternionType &other) const |
Matrix3 | operator* (const Matrix3 &other) const |
Vector3 | operator* (const Vector3 &other) const |
AngleAxis | inverse () const |
AngleAxis & | operator= (const QuaternionType &q) |
template<typename Derived > | |
AngleAxis & | operator= (const MatrixBase< Derived > &m) |
template<typename Derived > | |
AngleAxis & | fromRotationMatrix (const MatrixBase< Derived > &m) |
Sets *this from a 3x3 rotation matrix. | |
Matrix3 | toRotationMatrix (void) const |
template<typename NewScalarType > | |
internal::cast_return_type < AngleAxis, AngleAxis < NewScalarType > >::type | cast () const |
template<typename OtherScalarType > | |
AngleAxis (const AngleAxis< OtherScalarType > &other) | |
bool | isApprox (const AngleAxis &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const |
AngleAxis () | |
template<typename Derived > | |
AngleAxis (Scalar angle, const MatrixBase< Derived > &axis) | |
template<typename QuatDerived > | |
AngleAxis (const QuaternionBase< QuatDerived > &q) | |
template<typename Derived > | |
AngleAxis (const MatrixBase< Derived > &m) | |
Scalar | angle () const |
Scalar & | angle () |
const Vector3 & | axis () const |
Vector3 & | axis () |
QuaternionType | operator* (const AngleAxis &other) const |
QuaternionType | operator* (const QuaternionType &other) const |
AngleAxis | inverse () const |
template<class QuatDerived > | |
AngleAxis & | operator= (const QuaternionBase< QuatDerived > &q) |
template<typename Derived > | |
AngleAxis & | operator= (const MatrixBase< Derived > &m) |
template<typename Derived > | |
AngleAxis & | fromRotationMatrix (const MatrixBase< Derived > &m) |
Matrix3 | toRotationMatrix (void) const |
template<typename NewScalarType > | |
internal::cast_return_type < AngleAxis, AngleAxis < NewScalarType > >::type | cast () const |
template<typename OtherScalarType > | |
AngleAxis (const AngleAxis< OtherScalarType > &other) | |
bool | isApprox (const AngleAxis &other, typename NumTraits< Scalar >::Real prec=NumTraits< Scalar >::dummy_precision()) const |
Static Public Member Functions | |
static const AngleAxis | Identity () |
Protected Attributes | |
Vector3 | m_axis |
Scalar | m_angle |
Friends | |
QuaternionType | operator* (const QuaternionType &a, const AngleAxis &b) |
Matrix3 | operator* (const Matrix3 &a, const AngleAxis &b) |
QuaternionType | operator* (const QuaternionType &a, const AngleAxis &b) |
Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.
_Scalar | the scalar type, i.e., the type of the coefficients. |
The following two typedefs are provided for convenience:
AngleAxisf
for float
AngleAxisd
for double
AngleAxisForEuler How to define a rotation from Euler-angles
Combined with MatrixBase::Unit{X,Y,Z}, AngleAxis can be used to easily mimic Euler-angles. Here is an example:
Output:
_Scalar | the scalar type, i.e., the type of the coefficients. |
The following two typedefs are provided for convenience:
AngleAxisf
for float
AngleAxisd
for double
Combined with MatrixBase::Unit{X,Y,Z}, AngleAxis can be used to easily mimic Euler-angles. Here is an example:
Output:
typedef Quaternion<Scalar> AngleAxis< _Scalar >::QuaternionType |
typedef Quaternion<Scalar> AngleAxis< _Scalar >::QuaternionType |
the scalar type of the coefficients
Reimplemented from RotationBase< AngleAxis< _Scalar >, 3 >.
the scalar type of the coefficients
Reimplemented from RotationBase< AngleAxis< _Scalar >, 3 >.
Default constructor without initialization.
AngleAxis< _Scalar >::AngleAxis | ( | Scalar | angle, | |
const MatrixBase< Derived > & | axis | |||
) | [inline] |
Constructs and initialize the angle-axis rotation from an angle in radian and an axis which must be normalized.
AngleAxis< _Scalar >::AngleAxis | ( | const QuaternionType & | q | ) | [inline] |
Constructs and initialize the angle-axis rotation from a quaternion q.
AngleAxis< _Scalar >::AngleAxis | ( | const MatrixBase< Derived > & | m | ) | [inline, explicit] |
Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix.
AngleAxis< _Scalar >::AngleAxis | ( | const AngleAxis< OtherScalarType > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
Default constructor without initialization.
AngleAxis< _Scalar >::AngleAxis | ( | Scalar | angle, | |
const MatrixBase< Derived > & | axis | |||
) | [inline] |
Constructs and initialize the angle-axis rotation from an angle in radian and an axis which must be normalized.
AngleAxis< _Scalar >::AngleAxis | ( | const QuaternionBase< QuatDerived > & | q | ) | [inline, explicit] |
Constructs and initialize the angle-axis rotation from a quaternion q.
AngleAxis< _Scalar >::AngleAxis | ( | const MatrixBase< Derived > & | m | ) | [inline, explicit] |
Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix.
AngleAxis< _Scalar >::AngleAxis | ( | const AngleAxis< OtherScalarType > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
internal::cast_return_type<AngleAxis,AngleAxis<NewScalarType> >::type AngleAxis< _Scalar >::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::cast_return_type<AngleAxis,AngleAxis<NewScalarType> >::type AngleAxis< _Scalar >::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
.
AngleAxis& AngleAxis< _Scalar >::fromRotationMatrix | ( | const MatrixBase< Derived > & | m | ) |
AngleAxis< Scalar > & AngleAxis< Scalar >::fromRotationMatrix | ( | const MatrixBase< Derived > & | m | ) |
Sets *this
from a 3x3 rotation matrix.
static const AngleAxis AngleAxis< _Scalar >::Identity | ( | ) | [inline, static] |
Reimplemented from RotationBase< AngleAxis< _Scalar >, 3 >.
Reimplemented from RotationBase< AngleAxis< _Scalar >, 3 >.
bool AngleAxis< _Scalar >::isApprox | ( | const AngleAxis< _Scalar > & | other, | |
typename NumTraits< Scalar >::Real | prec = NumTraits<Scalar>::dummy_precision() | |||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.bool AngleAxis< _Scalar >::isApprox | ( | const AngleAxis< _Scalar > & | other, | |
typename NumTraits< Scalar >::Real | prec = precision<Scalar>() | |||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Vector3 AngleAxis< _Scalar >::operator* | ( | const Vector3 & | other | ) | const [inline] |
Applies rotation to vector
QuaternionType AngleAxis< _Scalar >::operator* | ( | const QuaternionType & | other | ) | const [inline] |
Concatenates two rotations
QuaternionType AngleAxis< _Scalar >::operator* | ( | const AngleAxis< _Scalar > & | other | ) | const [inline] |
Concatenates two rotations
Matrix3 AngleAxis< _Scalar >::operator* | ( | const Matrix3 & | other | ) | const [inline] |
Concatenates two rotations
QuaternionType AngleAxis< _Scalar >::operator* | ( | const AngleAxis< _Scalar > & | other | ) | const [inline] |
Concatenates two rotations
QuaternionType AngleAxis< _Scalar >::operator* | ( | const QuaternionType & | other | ) | const [inline] |
Concatenates two rotations
AngleAxis< Scalar > & AngleAxis< Scalar >::operator= | ( | const MatrixBase< Derived > & | mat | ) |
Set *this
from a 3x3 rotation matrix mat.
AngleAxis< Scalar > & AngleAxis< Scalar >::operator= | ( | const QuaternionType & | q | ) |
Set *this
from a quaternion. The axis is normalized.
AngleAxis& AngleAxis< _Scalar >::operator= | ( | const MatrixBase< Derived > & | m | ) |
AngleAxis< Scalar > & AngleAxis< Scalar >::operator= | ( | const QuaternionBase< QuatDerived > & | q | ) |
Set *this
from a unit quaternion. The axis is normalized.
AngleAxis< Scalar >::Matrix3 AngleAxis< Scalar >::toRotationMatrix | ( | void | ) | const |
Constructs and
Reimplemented from RotationBase< AngleAxis< _Scalar >, 3 >.
Reimplemented from RotationBase< AngleAxis< _Scalar >, 3 >.
QuaternionType operator* | ( | const QuaternionType & | a, | |
const AngleAxis< _Scalar > & | b | |||
) | [friend] |
Concatenates two rotations
QuaternionType operator* | ( | const QuaternionType & | a, | |
const AngleAxis< _Scalar > & | b | |||
) | [friend] |
Concatenates two rotations
Matrix3 operator* | ( | const Matrix3 & | a, | |
const AngleAxis< _Scalar > & | b | |||
) | [friend] |
Concatenates two rotations