#include <attitude-utils.hpp>
|
decimal | real |
| The real component.
|
|
decimal | i |
| The i component.
|
|
decimal | j |
| The j component.
|
|
decimal | k |
| The k component.
|
|
A Quaternion is a mutable object that represents a Quaternion. A Quaternion is a common way to represent rotations in 3D.
◆ Quaternion() [1/3]
found::Quaternion::Quaternion |
( |
const Vec3 & |
input | ) |
|
|
explicit |
Creates a "pure quaternion" with the given vector for imaginary parts and zero for real part.
- Parameters
-
input | The vector representing the imaginary part of the Quaternion to create |
◆ Quaternion() [2/3]
found::Quaternion::Quaternion |
( |
const Vec3 & |
input, |
|
|
decimal |
theta |
|
) |
| |
Create a quaternion which represents a rotation of theta around the axis input
- Parameters
-
input | the axis about which theta is defined |
theta | the rotation about the input |
◆ Quaternion() [3/3]
found::Quaternion::Quaternion |
( |
decimal |
real, |
|
|
decimal |
i, |
|
|
decimal |
j, |
|
|
decimal |
k |
|
) |
| |
|
inline |
Creates a Quaternion with components
- Parameters
-
real | The real component |
i | The i component |
j | The j component |
k | The k component |
Initializes this to be {real + iI + jJ + kK}
◆ Angle()
decimal found::Quaternion::Angle |
( |
| ) |
const |
Provides the amount of rotations represented by this Quaterion
- Returns
- The amount of rotations represented by this, in radians
◆ Canonicalize()
Quaternion found::Quaternion::Canonicalize |
( |
| ) |
const |
Provides the canonicalized Quaternion of this, if it is not already canonicalized
- Returns
- The canonicalized Quaternion of this, which is this iff this is a canonicalized Quaternion already, and a new Quaternion if it is not
◆ IsUnit()
bool found::Quaternion::IsUnit |
( |
decimal |
tolerance | ) |
const |
Tells client if this Quarternion is a unit quaternion
- Returns
- true iff this is a unit Quaternion
◆ Rotate()
Vec3 found::Quaternion::Rotate |
( |
const Vec3 & |
input | ) |
const |
Rotates a vector about this Quaternion
- Parameters
-
input | The vector to rotate about this |
- Returns
- The input vector that has been rotated about this
◆ SetAngle()
void found::Quaternion::SetAngle |
( |
decimal |
newAngle | ) |
|
Changes the rotation represented in this quarterion
- Parameters
-
newAngle | The rotation angle this new quarternion should represent |
- Postcondition
- Changes this by altering the rotation angle of this by newAngle
◆ SetVector()
void found::Quaternion::SetVector |
( |
const Vec3 & |
vec | ) |
|
Set imaginary components of Quarterion.
- Parameters
-
vec | The vector holding the imaginary quantities |
◆ ToSpherical()
Converts this Quarterion to a new system of Euler Angles by extracting the rotations described by this quarterion
- Returns
- An EulerAngles object representing this in with Euler Angles
The documentation for this class was generated from the following files: