Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXQuatd Class Reference

Double-precision quaternion. More...

#include <FXQuatd.h>

Public Member Functions

 FXQuatd ()
 Default constructor; value is not initialized.
 
 FXQuatd (const FXQuatd &q)
 Copy constructor.
 
 FXQuatd (const FXdouble v[])
 Construct from array of four doubles.
 
 FXQuatd (FXdouble xx, FXdouble yy, FXdouble zz, FXdouble ww)
 Construct from four components.
 
 FXQuatd (const FXVec3d &axis, FXdouble phi)
 Construct from rotation axis and angle in radians.
 
 FXQuatd (const FXVec3d &fr, const FXVec3d &to)
 Construct quaternion from arc between two unit vectors fm and to.
 
 FXQuatd (FXdouble roll, FXdouble pitch, FXdouble yaw)
 Construct from euler angles yaw (z), pitch (y), and roll (x).
 
 FXQuatd (const FXVec3d &ex, const FXVec3d &ey, const FXVec3d &ez)
 Construct quaternion from three orthogonal unit vectors.
 
 FXQuatd (const FXVec3d &rot)
 Construct quaternion from rotation vector rot, representing a rotation by |rot| radians about a unit vector rot/|rot|.
 
FXdouble & operator[] (FXint i)
 Return a non-const reference to the ith element.
 
const FXdouble & operator[] (FXint i) const
 Return a const reference to the ith element.
 
FXQuatdoperator= (const FXQuatd &v)
 Assignment from other quaternion.
 
FXQuatdoperator= (const FXdouble v[])
 Assignment from array of four doubles.
 
FXQuatdset (const FXQuatd &v)
 Set value from another quaternion.
 
FXQuatdset (const FXdouble v[])
 Set value from array of four doubles.
 
FXQuatdset (FXdouble xx, FXdouble yy, FXdouble zz, FXdouble ww)
 Set value from four components.
 
FXQuatdoperator*= (FXdouble n)
 Assigning operators.
 
FXQuatdoperator/= (FXdouble n)
 
FXQuatdoperator+= (const FXQuatd &v)
 
FXQuatdoperator-= (const FXQuatd &v)
 
FXQuatdoperator*= (const FXQuatd &b)
 
FXQuatdoperator/= (const FXQuatd &b)
 
 operator FXdouble * ()
 Conversion.
 
 operator const FXdouble * () const
 
 operator FXVec3d & ()
 Conversion to 3-vector, axis of rotation.
 
 operator const FXVec3d & () const
 
FXbool operator! () const
 Test if zero.
 
FXQuatd operator+ () const
 Unary.
 
FXQuatd operator- () const
 
FXdouble length2 () const
 Length and square of length.
 
FXdouble length () const
 
FXQuatdadjust ()
 Adjust quaternion length.
 
void setAxisAngle (const FXVec3d &axis, FXdouble phi)
 Set quaternion from axis and angle. More...
 
void getAxisAngle (FXVec3d &axis, FXdouble &phi) const
 Obtain axis and angle from quaternion. More...
 
void setRotation (const FXVec3d &rot)
 Set quaternion from rotation vector rot, representing a rotation by |rot| radians about a unit vector rot/|rot|. More...
 
FXVec3d getRotation () const
 Get rotation vector from quaternion, representing a rotation of |rot| radians about an axis rot/|rot|. More...
 
void setMRP (const FXVec3d &m)
 Set unit quaternion to modified rodrigues parameters. More...
 
FXVec3d getMRP () const
 Return modified rodrigues parameters from unit quaternion.
 
void setRollPitchYaw (FXdouble roll, FXdouble pitch, FXdouble yaw)
 Set quaternion from roll (x), pitch (y), yaw (z), in that order.
 
void getRollPitchYaw (FXdouble &roll, FXdouble &pitch, FXdouble &yaw) const
 Return the roll (x), pitch (y), yaw (z) angles represented by the quaternion.
 
void setYawPitchRoll (FXdouble yaw, FXdouble pitch, FXdouble roll)
 Set quaternion from yaw (z), pitch (y), roll (x), in that order.
 
void getYawPitchRoll (FXdouble &yaw, FXdouble &pitch, FXdouble &roll) const
 Return the yaw (z), pitch (y), roll (x) angles represented by the quaternion.
 
void setRollYawPitch (FXdouble roll, FXdouble yaw, FXdouble pitch)
 Set quaternion from roll (x), yaw (z), pitch (y), in that order.
 
void getRollYawPitch (FXdouble &roll, FXdouble &yaw, FXdouble &pitch) const
 Return the roll (x), yaw (z), pitch (y) angles represented by the quaternion.
 
void setPitchRollYaw (FXdouble pitch, FXdouble roll, FXdouble yaw)
 Set quaternion from pitch (y), roll (x),yaw (z), in that order.
 
void getPitchRollYaw (FXdouble &pitch, FXdouble &roll, FXdouble &yaw) const
 Return the pitch (y), roll (x),yaw (z) angles represented by the quaternion.
 
void setPitchYawRoll (FXdouble pitch, FXdouble yaw, FXdouble roll)
 Set quaternion from pitch (y), yaw (z), roll (x), in that order.
 
void getPitchYawRoll (FXdouble &pitch, FXdouble &yaw, FXdouble &roll) const
 Return the pitch (y), yaw (z), roll (x) angles represented by the quaternion.
 
void setYawRollPitch (FXdouble yaw, FXdouble roll, FXdouble pitch)
 Set quaternion from yaw (z), roll (x), pitch (y), in that order.
 
void getYawRollPitch (FXdouble &yaw, FXdouble &roll, FXdouble &pitch) const
 Return the yaw (z), roll (x), pitch (y) angles represented by the quaternion.
 
void setAxes (const FXVec3d &ex, const FXVec3d &ey, const FXVec3d &ez)
 Set quaternion from axes.
 
void getAxes (FXVec3d &ex, FXVec3d &ey, FXVec3d &ez) const
 Get quaternion axes.
 
FXVec3d getXAxis () const
 Obtain local x axis.
 
FXVec3d getYAxis () const
 Obtain local y axis.
 
FXVec3d getZAxis () const
 Obtain local z axis.
 
FXQuatd exp () const
 Exponentiate quaternion.
 
FXQuatd log () const
 Take logarithm of quaternion.
 
FXQuatd pow (FXdouble t) const
 Power of quaternion.
 
FXQuatd conj () const
 Conjugate quaternion.
 
FXQuatd unitinvert () const
 Invert unit quaternion.
 
FXQuatd invert () const
 Invert quaternion.
 
 ~FXQuatd ()
 Destructor.
 

Public Attributes

double x
 
double y
 
double z
 
double w
 

Detailed Description

Double-precision quaternion.

Member Function Documentation

◆ getAxisAngle()

void FX::FXQuatd::getAxisAngle ( FXVec3d axis,
FXdouble &  phi 
) const

Obtain axis and angle from quaternion.

Return unit vector and angle of rotation phi, in radians. If identity quaternion (0,0,0,1), return axis as (1,0.0).

◆ getRotation()

FXVec3d FX::FXQuatd::getRotation ( ) const

Get rotation vector from quaternion, representing a rotation of |rot| radians about an axis rot/|rot|.

If quaternion is identity quaternion (0,0,0,1), return (0,0,0).

◆ setAxisAngle()

void FX::FXQuatd::setAxisAngle ( const FXVec3d axis,
FXdouble  phi 
)

Set quaternion from axis and angle.

Quaternion represents a rotation of phi radians about unit vector axis.

◆ setMRP()

void FX::FXQuatd::setMRP ( const FXVec3d m)

Set unit quaternion to modified rodrigues parameters.

Modified Rodriques parameters are defined as MRP = tan(theta/4)*E, where theta is rotation angle (radians), and E is unit axis of rotation.

◆ setRotation()

void FX::FXQuatd::setRotation ( const FXVec3d rot)

Set quaternion from rotation vector rot, representing a rotation by |rot| radians about a unit vector rot/|rot|.

Set to the identity quaternion (0,0,0,1) if the rotation vector is equal to (0,0,0).


The documentation for this class was generated from the following file:

Copyright © 1997-2022 Jeroen van der Zijp