This class defines a quaternion. A quaternion is a number system that extends the complex number. Quaternions are used in particular for calculations involving three-dimmensional space. Quaternions are been represented in this class as a scalar and a vector: [w, (x,y,z)]. More...
#include <Quaternion.h>
Public Member Functions | |
void | fromEuler (double roll, double pitch, double yaw, TransformationTypes::EulerType type) |
This method sets the quaternion data with euler data. Sets the quaternion components [w, (x,y,z)] of the object with the specific euler data (roll, pitch, yaw). The euler system (euler321, euler123, ...) must be specified to know what is the transformation to applied. | |
double | getW () const |
double | getX () const |
double | getY () const |
double | getZ () const |
Quaternion () | |
Default constructor. Initialize the quaternion as [1, (0,0,0)]. | |
Quaternion (double w, double x, double y, double z) | |
This constructor initialize the quaternion as [w, (x,y,z)]. | |
double * | toArray () |
This method returns a new array with the quaternion data. The size of the array will be four. The first element will be the scalar. the second element will be the x component of the vector. the third element will be the y component of the vector. the fourth element will be the z component of the vector. | |
Private Attributes | |
double | w |
double | x |
double | y |
double | z |
Friends | |
std::ostream & | operator<< (std::ostream &o, Quaternion q) |
This class defines a quaternion. A quaternion is a number system that extends the complex number. Quaternions are used in particular for calculations involving three-dimmensional space. Quaternions are been represented in this class as a scalar and a vector: [w, (x,y,z)].
Definition at line 25 of file Quaternion.h.
rotateOp::Quaternion::Quaternion | ( | ) | [inline] |
Default constructor. Initialize the quaternion as [1, (0,0,0)].
Definition at line 38 of file Quaternion.h.
rotateOp::Quaternion::Quaternion | ( | double | w, |
double | x, | ||
double | y, | ||
double | z | ||
) | [inline] |
This constructor initialize the quaternion as [w, (x,y,z)].
w | The scalar. |
x | The x component of the vector. |
y | The y component of the vector. |
z | The z component of the vector. |
Definition at line 54 of file Quaternion.h.
void rotateOp::Quaternion::fromEuler | ( | double | roll, |
double | pitch, | ||
double | yaw, | ||
TransformationTypes::EulerType | type | ||
) | [inline] |
This method sets the quaternion data with euler data. Sets the quaternion components [w, (x,y,z)] of the object with the specific euler data (roll, pitch, yaw). The euler system (euler321, euler123, ...) must be specified to know what is the transformation to applied.
roll | The euler roll angle in radians. |
pitch | The euler pitch angle in radians. |
yaw | The euler yaw angle in radians. |
type | The euler system. The options can be EULER123, EULER321 or EULER 312 |
Definition at line 72 of file Quaternion.h.
double rotateOp::Quaternion::getW | ( | ) | const [inline] |
Definition at line 138 of file Quaternion.h.
double rotateOp::Quaternion::getX | ( | ) | const [inline] |
Definition at line 142 of file Quaternion.h.
double rotateOp::Quaternion::getY | ( | ) | const [inline] |
Definition at line 146 of file Quaternion.h.
double rotateOp::Quaternion::getZ | ( | ) | const [inline] |
Definition at line 150 of file Quaternion.h.
double* rotateOp::Quaternion::toArray | ( | ) | [inline] |
This method returns a new array with the quaternion data. The size of the array will be four. The first element will be the scalar. the second element will be the x component of the vector. the third element will be the y component of the vector. the fourth element will be the z component of the vector.
ATENTION: The array that this method returns must be deleted for the client.
Definition at line 123 of file Quaternion.h.
std::ostream& operator<< | ( | std::ostream & | o, |
Quaternion | q | ||
) | [friend] |
Definition at line 132 of file Quaternion.h.
double rotateOp::Quaternion::w [private] |
Definition at line 28 of file Quaternion.h.
double rotateOp::Quaternion::x [private] |
Definition at line 29 of file Quaternion.h.
double rotateOp::Quaternion::y [private] |
Definition at line 30 of file Quaternion.h.
double rotateOp::Quaternion::z [private] |
Definition at line 31 of file Quaternion.h.