#include <FGQuaternion.h>
Inherits FGJSBBase.
Note: The order of rotations used in this class corresponds to a 3-2-1 sequence, or Y-P-R, or Z-Y-X, if you prefer.
D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices", JSC 12960, July 1977
Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at NASA-Ames", NASA CR-2497, January 1975
Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics", Wiley & Sons, 1979 ISBN 0-471-03032-5
Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons, 1982 ISBN 0-471-08936-2
Definition at line 91 of file FGQuaternion.h.
Public Member Functions | |
| FGQuaternion | Conjugate (void) const |
| Conjugate of the quaternion. | |
| double & | Entry (unsigned int idx) |
| Write access the entries of the vector. | |
| double | Entry (unsigned int idx) const |
| Read access the entries of the vector. | |
| FGQuaternion (int idx, double angle) | |
| Initializer by one euler angle. | |
| FGQuaternion (double phi, double tht, double psi) | |
| Initializer by euler angles. | |
| FGQuaternion (const FGQuaternion &q) | |
| Copy constructor. | |
| FGQuaternion () | |
| Default initializer. | |
| double | GetCosEuler (int i) const |
| Retrieves cosine of the given euler angle. | |
| double | GetEuler (int i) const |
| Retrieves the Euler angles. | |
| const FGColumnVector3 & | GetEuler (void) const |
| Retrieves the Euler angles. | |
| double | GetEulerDeg (int i) const |
| Retrieves the Euler angles. | |
| FGQuaternion | GetQDot (const FGColumnVector3 &PQR) const |
| Quaternion derivative for given angular rates. | |
| double | GetSinEuler (int i) const |
| Retrieves sine of the given euler angle. | |
| const FGMatrix33 & | GetT (void) const |
| Transformation matrix. | |
| const FGMatrix33 & | GetTInv (void) const |
| Backward transformation matrix. | |
| FGQuaternion | Inverse (void) const |
| Inverse of the quaternion. | |
| double | Magnitude (void) const |
| Length of the vector. | |
| void | Normalize (void) |
| Normialze. | |
| bool | operator!= (const FGQuaternion &q) const |
| Comparison operator "!=". | |
| double & | operator() (unsigned int idx) |
| Write access the entries of the vector. | |
| double | operator() (unsigned int idx) const |
| Read access the entries of the vector. | |
| FGQuaternion | operator* (const FGQuaternion &q) const |
| Arithmetic operator "*". | |
| const FGQuaternion & | operator*= (const FGQuaternion &q) |
| Arithmetic operator "*=". | |
| const FGQuaternion & | operator*= (double scalar) |
| Arithmetic operator "*=". | |
| FGQuaternion | operator+ (const FGQuaternion &q) const |
| Arithmetic operator "+". | |
| const FGQuaternion & | operator+= (const FGQuaternion &q) |
| FGQuaternion | operator- (const FGQuaternion &q) const |
| Arithmetic operator "-". | |
| const FGQuaternion & | operator-= (const FGQuaternion &q) |
| Arithmetic operator "-=". | |
| const FGQuaternion & | operator/= (double scalar) |
| Arithmetic operator "/=". | |
| const FGQuaternion & | operator= (const FGQuaternion &q) |
| Assignment operator "=". | |
| bool | operator== (const FGQuaternion &q) const |
| Comparison operator "==". | |
| double | SqrMagnitude (void) const |
| Square of the length of the vector. | |
| ~FGQuaternion () | |
| Destructor. | |
Static Public Member Functions | |
| static FGQuaternion | zero (void) |
| Zero quaternion vector. | |
Friends | |
| FGQuaternion | operator* (double, const FGQuaternion &) |
| Scalar multiplication. | |
| FGQuaternion | ( | ) | [inline] |
Default initializer, initializes the class with the identity rotation.
Definition at line 96 of file FGQuaternion.h.
| FGQuaternion | ( | const FGQuaternion & | q | ) |
Copy constructor, initializes the quaternion.
| q | a constant reference to another FGQuaternion instance |
Definition at line 65 of file FGQuaternion.cpp.
| FGQuaternion | ( | double | phi, | |
| double | tht, | |||
| double | psi | |||
| ) |
Initialize the quaternion with the euler angles.
| phi | The euler X axis (roll) angle in radians | |
| tht | The euler Y axis (attitude) angle in radians | |
| psi | The euler Z axis (heading) angle in radians |
Definition at line 83 of file FGQuaternion.cpp.
| FGQuaternion | ( | int | idx, | |
| double | angle | |||
| ) | [inline] |
Initialize the quaternion with the single euler angle where its index is given in the first argument.
| idx | Index of the euler angle to initialize | |
| angle | The euler angle in radians |
Definition at line 118 of file FGQuaternion.h.
| FGQuaternion Conjugate | ( | void | ) | const [inline] |
Compute and return the conjugate of the quaternion. This one is equal to the inverse iff the quaternion is normalized.
Definition at line 407 of file FGQuaternion.h.
| double& Entry | ( | unsigned int | idx | ) | [inline] |
| idx | the component index. |
This function is just a shortcut for the double& operator()(unsigned int idx) function. It is used internally to access the elements in a more convenient way.
Note that the index given in the argument is unchecked.
Definition at line 264 of file FGQuaternion.h.
| double Entry | ( | unsigned int | idx | ) | const [inline] |
| idx | the component index. |
This function is just a shortcut for the double operator()(unsigned int idx) const function. It is used internally to access the elements in a more convenient way.
Note that the index given in the argument is unchecked.
Definition at line 249 of file FGQuaternion.h.
| double GetCosEuler | ( | int | i | ) | const [inline] |
Definition at line 209 of file FGQuaternion.h.
| double GetEuler | ( | int | i | ) | const [inline] |
| i | the euler angle index. units radians. |
Definition at line 183 of file FGQuaternion.h.
| const FGColumnVector3& GetEuler | ( | void | ) | const [inline] |
Definition at line 172 of file FGQuaternion.h.
| double GetEulerDeg | ( | int | i | ) | const [inline] |
| i | the euler angle index. |
Definition at line 193 of file FGQuaternion.h.
| FGQuaternion GetQDot | ( | const FGColumnVector3 & | PQR | ) | const |
Returns the derivative of the quaternion corresponding to the angular velocities PQR.
Computes the quaternion derivative which results from the given angular velocities
| PQR | a constant reference to the body rate vector |
Definition at line 115 of file FGQuaternion.cpp.
| double GetSinEuler | ( | int | i | ) | const [inline] |
Definition at line 201 of file FGQuaternion.h.
| const FGMatrix33& GetT | ( | void | ) | const [inline] |
Definition at line 161 of file FGQuaternion.h.
| const FGMatrix33& GetTInv | ( | void | ) | const [inline] |
Definition at line 166 of file FGQuaternion.h.
| FGQuaternion Inverse | ( | void | ) | const [inline] |
Compute and return the inverse of the quaternion so that the orientation represented with *this multiplied with the returned value is equal to the identity orientation.
Definition at line 393 of file FGQuaternion.h.
| double Magnitude | ( | void | ) | const [inline] |
Compute and return the euclidean norm of this vector.
Definition at line 417 of file FGQuaternion.h.
| void Normalize | ( | void | ) |
Normalize the vector to have the Magnitude() == 1.0. If the vector is equal to zero it is left untouched.
Definition at line 131 of file FGQuaternion.cpp.
| bool operator!= | ( | const FGQuaternion & | q | ) | const [inline] |
| q | a quaternion reference |
Definition at line 300 of file FGQuaternion.h.
| double& operator() | ( | unsigned int | idx | ) | [inline] |
| idx | the component index. |
Note that the index given in the argument is unchecked.
Definition at line 234 of file FGQuaternion.h.
| double operator() | ( | unsigned int | idx | ) | const [inline] |
| idx | the component index. |
Note that the index given in the argument is unchecked.
Definition at line 223 of file FGQuaternion.h.
| FGQuaternion operator* | ( | const FGQuaternion & | q | ) | const [inline] |
Multiplication of two quaternions is like performing successive rotations.
| q | a quaternion to be multiplied. |
Definition at line 363 of file FGQuaternion.h.
| const FGQuaternion& operator*= | ( | const FGQuaternion & | q | ) | [inline] |
Multiplication of two quaternions is like performing successive rotations.
| q | a quaternion to be multiplied. |
Definition at line 374 of file FGQuaternion.h.
| const FGQuaternion& operator*= | ( | double | scalar | ) | [inline] |
| scalar | a multiplicative value. |
Definition at line 327 of file FGQuaternion.h.
| FGQuaternion operator+ | ( | const FGQuaternion & | q | ) | const [inline] |
| q | a quaternion to be summed. |
Definition at line 346 of file FGQuaternion.h.
| FGQuaternion operator- | ( | const FGQuaternion & | q | ) | const [inline] |
| q | a quaternion to be subtracted. |
Definition at line 354 of file FGQuaternion.h.
| const FGQuaternion& operator-= | ( | const FGQuaternion & | q | ) | [inline] |
| q | a quaternion reference. |
Definition at line 314 of file FGQuaternion.h.
| const FGQuaternion& operator/= | ( | double | scalar | ) | [inline] |
| scalar | a divisor value. |
Definition at line 339 of file FGQuaternion.h.
| const FGQuaternion& operator= | ( | const FGQuaternion & | q | ) | [inline] |
Assign the value of q to the current object. Cached values are conserved.
| q | reference to an FGQuaternion instance |
Definition at line 271 of file FGQuaternion.h.
| bool operator== | ( | const FGQuaternion & | q | ) | const [inline] |
| q | a quaternion reference |
Definition at line 292 of file FGQuaternion.h.
| double SqrMagnitude | ( | void | ) | const [inline] |
Compute and return the square of the euclidean norm of this vector.
Definition at line 423 of file FGQuaternion.h.
| static FGQuaternion zero | ( | void | ) | [inline, static] |
Does not represent any orientation. Useful for initialization of increments
Definition at line 437 of file FGQuaternion.h.
| FGQuaternion operator* | ( | double | scalar, | |
| const FGQuaternion & | q | |||
| ) | [friend] |
| scalar | scalar value to multiply with. | |
| q | Vector to multiply. |
Definition at line 491 of file FGQuaternion.h.
1.5.5