InertiaSDK

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
inertia::Quaternion Struct Reference

Quaternion. More...

`#include <Quaternion.h>`

## Public Member Functions
| Quaternion ()
| Quaternion (double const &w, double const &x, double const &y, double const &z)
std::vector< double > | toEulerAngles (std::wstring const &order=L"ZYX") const

## Static Public Member Functions
static Quaternion | normalize (Quaternion const &q)
static Quaternion | inverse (Quaternion const &q)
static Quaternion | multiply (Quaternion const &p, Quaternion const &q)
static Quaternion | average (std::vector< Quaternion > const &qs)

## Public Attributes
double | w
| First quaternion component.
double | x
| Second quaternion component.
double | y
| Third quaternion component.
double | z
| Fourth quaternion component.

## Detailed Description

Quaternion.

A Simple quaternion container.

## Constructor & Destructor Documentation

## ◆ Quaternion() [1/2]

inertia::Quaternion::Quaternion | ( |  | ) |

Default constructor. Creates a quaternion with values [1,0,0,0].

## ◆ Quaternion() [2/2]

inertia::Quaternion::Quaternion | ( | double const & | w,
|  | double const & | x,
|  | double const & | y,
|  | double const & | z )

Constructor with quaternion components.

Parameters

  w | the first component
  x | the second component
  y | the third component
  z | the fourth component

## Member Function Documentation

## ◆ average()

Quaternion inertia::Quaternion::average | ( | std::vector< Quaternion > const & | qs | ) |
| static

Return the average (slerp) of the given quaternions. NOTE: not verified.

Parameters

  qs | the vector of quaternions to average

Returns
  the averaged quaternion

## ◆ inverse()

Quaternion inertia::Quaternion::inverse | ( | Quaternion const & | q | ) |
| static

Inverse the given (normalzized) quaternion.

Parameters

  q | the quaternion to inverse

Returns
  the inversed quaternion

## ◆ multiply()

Quaternion inertia::Quaternion::multiply | ( | Quaternion const & | p,
|  | Quaternion const & | q )
| static

Multiply the given (normalzized) quaternions (r=pq).

Parameters

  p | the first quaternion to multiply
  q | the second quaternion to multiply

Returns
  the multiplied quaternion

## ◆ normalize()

Quaternion inertia::Quaternion::normalize | ( | Quaternion const & | q | ) |
| static

Normalize the given quaternion.

Parameters

  q | the quaternion to normalize

Returns
  the normalized quaternion

## ◆ toEulerAngles()

std::vector< double > inertia::Quaternion::toEulerAngles | ( | std::wstring const & | order = L"ZYX" | ) | const

Returns 3 Euler angles. default in ZYX order.

Parameters

  order | the rotation order

Returns
  the vector with 3 Euler angles

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

- Quaternion.h