- Aldebaran documentation |
- C++ Libraries |
- index

libalmath 2.8.7.4

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
AL::Math::Quaternion Struct Reference
Types

Create and play with a Quaternion. More...

`#include <alquaternion.h>`

## Public Member Functions
| Quaternion ()
| Create a Quaternion initialize with 0.0f. More...
| Quaternion (float pW, float pX, float pY, float pZ)
| Create a Quaternion initialize with explicit value. More...
| Quaternion (const std::vector< float > &pFloats)
| Create a Quaternion with an std::vector. More...
Quaternion & | operator*= (const Quaternion &pQua2)
| Overloading of operator *= for Quaternion. More...
Quaternion | operator* (const Quaternion &pQua2) const
| Overloading of operator * for Quaternion. More...
bool | operator== (const Quaternion &pQua2) const
| Overloading of operator == for Quaternion. More...
bool | operator!= (const Quaternion &pQua2) const
| Overloading of operator != for Quaternion. More...
Quaternion | operator* (float pVal) const
| Overloading of operator * for Quaternion. More...
Quaternion | operator/ (float pVal) const
| Overloading of operator / for Quaternion. More...
Quaternion & | operator*= (float pVal)
| Overloading of operator *= for Quaternion. More...
Quaternion & | operator/= (float pVal)
| Overloading of operator /= for Quaternion. More...
bool | isNear (const Quaternion &pQua2, const float &pEpsilon=0.0001f) const
| Check if the actual Quaternion is near the one give in argument. More...
float | norm () const
| Compute the norm of the actual Quaternion. More...
Quaternion | normalize () const
| Normalize the actual Quaterion. More...
Quaternion | inverse () const
| Compute the quaternion inverse of the actual Quaternion More...
void | toVector (std::vector< float > &pReturnVector) const
| Return the Quaternion as a vector of float [w, x, y, z]. More...
std::vector< float > | toVector (void) const

## Static Public Member Functions
static Quaternion | fromAngleAndAxisRotation (const float pAngle, const float pAxisX, const float pAxisY, const float pAxisZ)
| Create a Quaternion initialized with explicit angle and axis rotation. More...

## Public Attributes
float | w
float | x
float | y
float | z

## Detailed Description

Create and play with a Quaternion.

A Quaternion is just defined by w, x, y and z.

Definition at line 24 of file alquaternion.h.

## Constructor & Destructor Documentation

AL::Math::Quaternion::Quaternion | ( |  | ) |

Create a Quaternion initialize with 0.0f.

AL::Math::Quaternion::Quaternion | ( | float | pW,
|  | float | pX,
|  | float | pY,
|  | float | pZ
| ) |  |

Create a Quaternion initialize with explicit value.

Parameters

  pW | the float value for w
  pX | the float value for x
  pY | the float value for y
  pZ | the float value for z

AL::Math::Quaternion::Quaternion | ( | const std::vector< float > & | pFloats | ) |

Create a Quaternion with an std::vector.

Parameters

  pFloats | An std::vector<float> of size 4 for respectively: w, x, y and z

## Member Function Documentation

static Quaternion AL::Math::Quaternion::fromAngleAndAxisRotation | ( | const float | pAngle,
|  | const float | pAxisX,
|  | const float | pAxisY,
|  | const float | pAxisZ
| ) |  |
| static

Create a Quaternion initialized with explicit angle and axis rotation.

Parameters

  pAngle | the float value for angle in radian around axis rotation
  pAxisX | the float value for x value of axis rotation
  pAxisY | the float value for y value of axis rotation
  pAxisZ | the float value for z value of axis rotation

Quaternion AL::Math::Quaternion::inverse | ( |  | ) | const

Compute the quaternion inverse of the actual Quaternion

Returns
  the Quaternion inverse

bool AL::Math::Quaternion::isNear | ( | const Quaternion & | pQua2,
|  | const float & | pEpsilon = `0.0001f`
| ) |  | const

Check if the actual Quaternion is near the one give in argument.

Parameters

  pQua2 | the second Quaternion
  pEpsilon | an optionnal epsilon distance

Returns
  true if the distance between the two Quaternion is less than pEpsilon Check if |Qua1+Qua2| < epsilon or |Qua1-Qua2| < epsilon

float AL::Math::Quaternion::norm | ( |  | ) | const

Compute the norm of the actual Quaternion.

Returns
  the float norm of the Quaternion

Quaternion AL::Math::Quaternion::normalize | ( |  | ) | const

Normalize the actual Quaterion.

Returns
  the Quaternion normalized

bool AL::Math::Quaternion::operator!= | ( | const Quaternion & | pQua2 | ) | const

Overloading of operator != for Quaternion.

Parameters

  pQua2 | the second Quaternion

Quaternion AL::Math::Quaternion::operator* | ( | const Quaternion & | pQua2 | ) | const
| inline

Overloading of operator * for Quaternion.

Parameters

  pQua2 | the second Quaternion

Definition at line 116 of file alquaternion.h.

Quaternion AL::Math::Quaternion::operator* | ( | float | pVal | ) | const
| inline

Overloading of operator * for Quaternion.

Parameters

  pVal | the float factor

Definition at line 141 of file alquaternion.h.

Quaternion& AL::Math::Quaternion::operator*= | ( | const Quaternion & | pQua2 | ) |

Overloading of operator *= for Quaternion.

Parameters

  pQua2 | the second Quaternion

Quaternion& AL::Math::Quaternion::operator*= | ( | float | pVal | ) |

Overloading of operator *= for Quaternion.

Parameters

  pVal | the float factor

Quaternion AL::Math::Quaternion::operator/ | ( | float | pVal | ) | const

Overloading of operator / for Quaternion.

Parameters

  pVal | the float factor

Quaternion& AL::Math::Quaternion::operator/= | ( | float | pVal | ) |

Overloading of operator /= for Quaternion.

Parameters

  pVal | the float factor

bool AL::Math::Quaternion::operator== | ( | const Quaternion & | pQua2 | ) | const

Overloading of operator == for Quaternion.

Parameters

  pQua2 | the second Quaternion

void AL::Math::Quaternion::toVector | ( | std::vector< float > & | pReturnVector | ) | const

Return the Quaternion as a vector of float [w, x, y, z].

std::vector<float> AL::Math::Quaternion::toVector | ( | void |  | ) | const

## Member Data Documentation

float AL::Math::Quaternion::w

Definition at line 26 of file alquaternion.h.

float AL::Math::Quaternion::x

Definition at line 28 of file alquaternion.h.

float AL::Math::Quaternion::y

Definition at line 30 of file alquaternion.h.

float AL::Math::Quaternion::z

Definition at line 32 of file alquaternion.h.

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

- /home/opennao/work/release-2.8/lib/libalmath/almath/types/alquaternion.h