#include <Rotation.h>

Public Member Functions

void getRawValue (Vector3d &axis, double &rfAngle) const
 Does the same as the method above unless normalizing the axis. More...
 
void getValue (double &q0, double &q1, double &q2, double &q3) const
 
void getValue (Matrix4D &matrix) const
 Returns this rotation in form of a matrix. More...
 
void getValue (Vector3d &axis, double &rfAngle) const
 If not a null quaternion then axis will be normalized. More...
 
const double * getValue (void) const
 Methods to get or set rotations. More...
 
void getYawPitchRoll (double &y, double &p, double &r) const
 Euler angles in yaw,pitch,roll notation. More...
 
Rotation inverse (void) const
 
Rotationinvert (void)
 Invert rotations. More...
 
bool isIdentity () const
 
bool isNull () const
 
bool isSame (const Rotation &) const
 
bool isSame (const Rotation &, double tol) const
 
Vector3d multVec (const Vector3d &src) const
 
void multVec (const Vector3d &src, Vector3d &dst) const
 
bool operator!= (const Rotation &q) const
 
Rotation operator* (const Rotation &q) const
 
Rotationoperator*= (const Rotation &q)
 Operators. More...
 
void operator= (const Rotation &)
 
bool operator== (const Rotation &q) const
 
double & operator[] (unsigned short usIndex)
 
const double & operator[] (unsigned short usIndex) const
 
 Rotation ()
 Construction. More...
 
 Rotation (const double q0, const double q1, const double q2, const double q3)
 Construct a rotation initialized with the given quaternion components: q0 = x, q1 = y, q2 = z and q3 = w, where the quaternion is specified by q=w+xi+yj+zk. More...
 
 Rotation (const double q[4])
 Construct a rotation initialized with the given quaternion components: q[0] = x, q[1] = y, q[2] = z and q[3] = w, where the quaternion is specified by q=w+xi+yj+zk. More...
 
 Rotation (const Matrix4D &matrix)
 
 Rotation (const Rotation &rot)
 
 Rotation (const Vector3d &axis, const double fAngle)
 Construct a rotation by rotation axis and angle. More...
 
 Rotation (const Vector3d &rotateFrom, const Vector3d &rotateTo)
 
void scaleAngle (const double scaleFactor)
 
void setValue (const double q0, const double q1, const double q2, const double q3)
 
void setValue (const double q[4])
 
void setValue (const Matrix4D &matrix)
 
void setValue (const Vector3d &axis, const double fAngle)
 
void setValue (const Vector3d &rotateFrom, const Vector3d &rotateTo)
 
void setYawPitchRoll (double y, double p, double r)
 Euler angles in yaw,pitch,roll notation. More...
 

Static Public Member Functions

static Rotation identity (void)
 
static Rotation makeRotationByAxes (Vector3d xdir, Vector3d ydir, Vector3d zdir, const char *priorityOrder="ZXY")
 makeRotationByAxes(xdir, ydir, zdir, priorityOrder): creates a rotation that converts a vector in local cs with axes given as arguments, into a vector in global cs. More...
 
static Rotation slerp (const Rotation &rot0, const Rotation &rot1, double t)
 Specialty constructors. More...
 

Constructor & Destructor Documentation

◆ Rotation() [1/7]

Rotation::Rotation ( )

Construction.

Referenced by identity(), makeRotationByAxes(), and slerp().

◆ Rotation() [2/7]

Rotation::Rotation ( const Vector3d axis,
const double  fAngle 
)

Construct a rotation by rotation axis and angle.

References setValue().

◆ Rotation() [3/7]

Rotation::Rotation ( const Matrix4D matrix)

References setValue().

◆ Rotation() [4/7]

Rotation::Rotation ( const double  q[4])

Construct a rotation initialized with the given quaternion components: q[0] = x, q[1] = y, q[2] = z and q[3] = w, where the quaternion is specified by q=w+xi+yj+zk.

References setValue().

◆ Rotation() [5/7]

Rotation::Rotation ( const double  q0,
const double  q1,
const double  q2,
const double  q3 
)

Construct a rotation initialized with the given quaternion components: q0 = x, q1 = y, q2 = z and q3 = w, where the quaternion is specified by q=w+xi+yj+zk.

References setValue().

◆ Rotation() [6/7]

Rotation::Rotation ( const Vector3d rotateFrom,
const Vector3d rotateTo 
)

References setValue().

◆ Rotation() [7/7]

Rotation::Rotation ( const Rotation rot)

Member Function Documentation

◆ getRawValue()

void Rotation::getRawValue ( Vector3d axis,
double &  rfAngle 
) const

Does the same as the method above unless normalizing the axis.

References Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

Referenced by Base::RotationPy::getRawAxis(), and Base::RotationPy::setAngle().

◆ getValue() [1/4]

void Rotation::getValue ( double &  q0,
double &  q1,
double &  q2,
double &  q3 
) const

◆ getValue() [2/4]

void Rotation::getValue ( Matrix4D matrix) const

Returns this rotation in form of a matrix.

◆ getValue() [3/4]

void Rotation::getValue ( Vector3d axis,
double &  rfAngle 
) const

◆ getValue() [4/4]

◆ getYawPitchRoll()

◆ identity()

Rotation Rotation::identity ( void  )
static

References Rotation().

◆ inverse()

Rotation Rotation::inverse ( void  ) const

◆ invert()

◆ isIdentity()

◆ isNull()

bool Rotation::isNull ( void  ) const

◆ isSame() [1/2]

bool Rotation::isSame ( const Rotation q) const

◆ isSame() [2/2]

bool Rotation::isSame ( const Rotation q,
double  tol 
) const

◆ makeRotationByAxes()

Rotation Rotation::makeRotationByAxes ( Vector3d  xdir,
Vector3d  ydir,
Vector3d  zdir,
const char *  priorityOrder = "ZXY" 
)
static

makeRotationByAxes(xdir, ydir, zdir, priorityOrder): creates a rotation that converts a vector in local cs with axes given as arguments, into a vector in global cs.

Parameters
xdiris wanted direction of local X axis
ydir...
zdir
priorityOrdersets which directions are followed. It is a string like "ZXY". This means, Z direction is followed precisely; X direction is corrected to be perpendicular to Z direction, and used; Y direction argument is ignored altogether (Y direction is generated from Z and X).

If only one vector provided is nonzero, the other two directions are picked automatically.

References Base::Vector3< _Precision >::Cross(), Base::Vector3< _Precision >::Length(), Base::Vector3< _Precision >::Normalize(), Rotation(), Base::Matrix4D::setToUnity(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

Referenced by Attacher::AttachEngine3D::calculateAttachedPlacement(), and Base::RotationPy::PyInit().

◆ multVec() [1/2]

Vector3d Rotation::multVec ( const Vector3d src) const

References multVec().

◆ multVec() [2/2]

void Rotation::multVec ( const Vector3d src,
Vector3d dst 
) const

◆ operator!=()

bool Rotation::operator!= ( const Rotation q) const

◆ operator*()

Rotation Rotation::operator* ( const Rotation q) const

◆ operator*=()

Rotation & Rotation::operator*= ( const Rotation q)

Operators.

References getValue(), and setValue().

◆ operator=()

void Rotation::operator= ( const Rotation rot)

◆ operator==()

bool Rotation::operator== ( const Rotation q) const

◆ operator[]() [1/2]

double& Base::Rotation::operator[] ( unsigned short  usIndex)

◆ operator[]() [2/2]

const double& Base::Rotation::operator[] ( unsigned short  usIndex) const

◆ scaleAngle()

void Rotation::scaleAngle ( const double  scaleFactor)

References getValue(), and setValue().

◆ setValue() [1/5]

void Rotation::setValue ( const double  q0,
const double  q1,
const double  q2,
const double  q3 
)

◆ setValue() [2/5]

void Rotation::setValue ( const double  q[4])

◆ setValue() [3/5]

void Rotation::setValue ( const Matrix4D matrix)

◆ setValue() [4/5]

◆ setValue() [5/5]

◆ setYawPitchRoll()

void Rotation::setYawPitchRoll ( double  y,
double  p,
double  r 
)

◆ slerp()

Rotation Rotation::slerp ( const Rotation rot0,
const Rotation rot1,
double  t 
)
static

The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Base/Rotation.h
  • Sources/FreeCAD/src/Base/Rotation.cpp