Holds a unit quaternion.
More...
#include <Quaternion.hpp>
|
| Quaternion ()=default |
|
| Quaternion (const NdArray< double > &inArray) |
|
| Quaternion (const NdArray< double > &inAxis, double inAngle) |
|
| Quaternion (const std::array< double, 4 > &components) noexcept |
|
| Quaternion (const Vec3 &inAxis, double inAngle) noexcept |
|
| Quaternion (double inI, double inJ, double inK, double inS) noexcept |
|
| Quaternion (double roll, double pitch, double yaw) noexcept |
|
double | angleOfRotation () const noexcept |
|
NdArray< double > | angularVelocity (const Quaternion &inQuat2, double inTime) const |
|
Vec3 | axisOfRotation () const noexcept |
|
Quaternion | conjugate () const noexcept |
|
double | i () const noexcept |
|
Quaternion | inverse () const noexcept |
|
double | j () const noexcept |
|
double | k () const noexcept |
|
Quaternion | nlerp (const Quaternion &inQuat2, double inPercent) const |
|
bool | operator!= (const Quaternion &inRhs) const noexcept |
|
NdArray< double > | operator* (const NdArray< double > &inVec) const |
|
Quaternion | operator* (const Quaternion &inRhs) const noexcept |
|
Vec3 | operator* (const Vec3 &inVec3) const |
|
Quaternion | operator* (double inScalar) const noexcept |
|
Quaternion & | operator*= (const Quaternion &inRhs) noexcept |
|
Quaternion & | operator*= (double inScalar) noexcept |
|
Quaternion | operator+ (const Quaternion &inRhs) const noexcept |
|
Quaternion & | operator+= (const Quaternion &inRhs) noexcept |
|
Quaternion | operator- () const noexcept |
|
Quaternion | operator- (const Quaternion &inRhs) const noexcept |
|
Quaternion & | operator-= (const Quaternion &inRhs) noexcept |
|
Quaternion | operator/ (const Quaternion &inRhs) const noexcept |
|
Quaternion & | operator/= (const Quaternion &inRhs) noexcept |
|
bool | operator== (const Quaternion &inRhs) const noexcept |
|
double | pitch () const noexcept |
|
void | print () const |
|
double | roll () const noexcept |
|
NdArray< double > | rotate (const NdArray< double > &inVector) const |
|
Vec3 | rotate (const Vec3 &inVec3) const |
|
double | s () const noexcept |
|
Quaternion | slerp (const Quaternion &inQuat2, double inPercent) const |
|
std::string | str () const |
|
NdArray< double > | toDCM () const |
|
NdArray< double > | toNdArray () const |
|
double | yaw () const noexcept |
|
◆ Quaternion() [1/7]
nc::rotations::Quaternion::Quaternion |
( |
| ) |
|
|
default |
◆ Quaternion() [2/7]
nc::rotations::Quaternion::Quaternion |
( |
double |
roll, |
|
|
double |
pitch, |
|
|
double |
yaw |
|
) |
| |
|
inlinenoexcept |
Constructor
- Parameters
-
roll | euler roll angle in radians |
pitch | euler pitch angle in radians |
yaw | euler yaw angle in radians |
◆ Quaternion() [3/7]
nc::rotations::Quaternion::Quaternion |
( |
double |
inI, |
|
|
double |
inJ, |
|
|
double |
inK, |
|
|
double |
inS |
|
) |
| |
|
inlinenoexcept |
◆ Quaternion() [4/7]
nc::rotations::Quaternion::Quaternion |
( |
const std::array< double, 4 > & |
components | ) |
|
|
inlinenoexcept |
◆ Quaternion() [5/7]
nc::rotations::Quaternion::Quaternion |
( |
const NdArray< double > & |
inArray | ) |
|
|
inline |
Constructor
- Parameters
-
inArray | if size = 3 the roll, pitch, yaw euler angles if size = 4 the i, j, k, s components if shape = [3, 3] then direction cosine matrix |
◆ Quaternion() [6/7]
nc::rotations::Quaternion::Quaternion |
( |
const Vec3 & |
inAxis, |
|
|
double |
inAngle |
|
) |
| |
|
inlinenoexcept |
Constructor
- Parameters
-
inAxis | Euler axis |
inAngle | Euler angle in radians |
◆ Quaternion() [7/7]
nc::rotations::Quaternion::Quaternion |
( |
const NdArray< double > & |
inAxis, |
|
|
double |
inAngle |
|
) |
| |
|
inline |
Constructor
- Parameters
-
inAxis | Euler axis x,y,z vector components |
inAngle | Euler angle in radians |
◆ angleOfRotation()
double nc::rotations::Quaternion::angleOfRotation |
( |
| ) |
const |
|
inlinenoexcept |
the angle of rotation around the rotation axis that is described by the quaternion
- Returns
- radians
◆ angularVelocity() [1/2]
static NdArray< double > nc::rotations::Quaternion::angularVelocity |
( |
const Quaternion & |
inQuat1, |
|
|
const Quaternion & |
inQuat2, |
|
|
double |
inTime |
|
) |
| |
|
inlinestatic |
angular velocity vector between the two quaternions. The norm of the array is the magnitude
- Parameters
-
inQuat1 | |
inQuat2 | |
inTime | (seperation time) |
- Returns
- NdArray<double>
◆ angularVelocity() [2/2]
NdArray< double > nc::rotations::Quaternion::angularVelocity |
( |
const Quaternion & |
inQuat2, |
|
|
double |
inTime |
|
) |
| const |
|
inline |
angular velocity vector between the two quaternions. The norm of the array is the magnitude
- Parameters
-
inQuat2 | |
inTime | (seperation time) |
- Returns
- NdArray<double>
◆ axisOfRotation()
Vec3 nc::rotations::Quaternion::axisOfRotation |
( |
| ) |
const |
|
inlinenoexcept |
the axis of rotation described by the quaternion
- Returns
- Vec3
◆ conjugate()
Quaternion nc::rotations::Quaternion::conjugate |
( |
| ) |
const |
|
inlinenoexcept |
◆ i()
double nc::rotations::Quaternion::i |
( |
| ) |
const |
|
inlinenoexcept |
returns the i component
- Returns
- double
◆ identity()
static Quaternion nc::rotations::Quaternion::identity |
( |
| ) |
|
|
inlinestaticnoexcept |
◆ inverse()
Quaternion nc::rotations::Quaternion::inverse |
( |
| ) |
const |
|
inlinenoexcept |
quaternion inverse
- Returns
- Quaterion
◆ j()
double nc::rotations::Quaternion::j |
( |
| ) |
const |
|
inlinenoexcept |
returns the j component
- Returns
- double
◆ k()
double nc::rotations::Quaternion::k |
( |
| ) |
const |
|
inlinenoexcept |
returns the k component
- Returns
- double
◆ nlerp() [1/2]
linearly interpolates between the two quaternions
- Parameters
-
inQuat1 | |
inQuat2 | |
inPercent | [0, 1] |
- Returns
- Quaternion
◆ nlerp() [2/2]
linearly interpolates between the two quaternions
- Parameters
-
- Returns
- Quaternion
◆ operator!=()
bool nc::rotations::Quaternion::operator!= |
( |
const Quaternion & |
inRhs | ) |
const |
|
inlinenoexcept |
equality operator
- Parameters
-
- Returns
- bool
◆ operator*() [1/4]
NdArray< double > nc::rotations::Quaternion::operator* |
( |
const NdArray< double > & |
inVec | ) |
const |
|
inline |
◆ operator*() [2/4]
multiplication operator
- Parameters
-
- Returns
- Quaternion
◆ operator*() [3/4]
Vec3 nc::rotations::Quaternion::operator* |
( |
const Vec3 & |
inVec3 | ) |
const |
|
inline |
multiplication operator
- Parameters
-
- Returns
- Vec3
◆ operator*() [4/4]
Quaternion nc::rotations::Quaternion::operator* |
( |
double |
inScalar | ) |
const |
|
inlinenoexcept |
multiplication operator, only useful for multiplying by negative 1, all others will be renormalized back out
- Parameters
-
- Returns
- Quaternion
◆ operator*=() [1/2]
multiplication assignment operator
- Parameters
-
- Returns
- Quaternion
◆ operator*=() [2/2]
Quaternion & nc::rotations::Quaternion::operator*= |
( |
double |
inScalar | ) |
|
|
inlinenoexcept |
multiplication operator, only useful for multiplying by negative 1, all others will be renormalized back out
- Parameters
-
- Returns
- Quaternion
◆ operator+()
◆ operator+=()
addition assignment operator
- Parameters
-
- Returns
- Quaternion
◆ operator-() [1/2]
Quaternion nc::rotations::Quaternion::operator- |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator-() [2/2]
◆ operator-=()
subtraction assignment operator
- Parameters
-
- Returns
- Quaternion
◆ operator/()
◆ operator/=()
division assignment operator
- Parameters
-
- Returns
- Quaternion
◆ operator==()
bool nc::rotations::Quaternion::operator== |
( |
const Quaternion & |
inRhs | ) |
const |
|
inlinenoexcept |
equality operator
- Parameters
-
- Returns
- bool
◆ pitch()
double nc::rotations::Quaternion::pitch |
( |
| ) |
const |
|
inlinenoexcept |
The euler pitch angle in radians
- Returns
- euler pitch angle in radians
◆ pitchRotation()
static Quaternion nc::rotations::Quaternion::pitchRotation |
( |
double |
inAngle | ) |
|
|
inlinestaticnoexcept |
returns a quaternion to rotate about the pitch axis
- Parameters
-
- Returns
- Quaternion
◆ print()
void nc::rotations::Quaternion::print |
( |
| ) |
const |
|
inline |
◆ roll()
double nc::rotations::Quaternion::roll |
( |
| ) |
const |
|
inlinenoexcept |
The euler roll angle in radians
- Returns
- euler roll angle in radians
◆ rollRotation()
static Quaternion nc::rotations::Quaternion::rollRotation |
( |
double |
inAngle | ) |
|
|
inlinestaticnoexcept |
returns a quaternion to rotate about the roll axis
- Parameters
-
- Returns
- Quaternion
◆ rotate() [1/2]
NdArray< double > nc::rotations::Quaternion::rotate |
( |
const NdArray< double > & |
inVector | ) |
const |
|
inline |
rotate a vector using the quaternion
- Parameters
-
inVector | (cartesian vector with x,y,z components) |
- Returns
- NdArray<double> (cartesian vector with x,y,z components)
◆ rotate() [2/2]
Vec3 nc::rotations::Quaternion::rotate |
( |
const Vec3 & |
inVec3 | ) |
const |
|
inline |
rotate a vector using the quaternion
- Parameters
-
- Returns
- Vec3
◆ s()
double nc::rotations::Quaternion::s |
( |
| ) |
const |
|
inlinenoexcept |
returns the s component
- Returns
- double
◆ slerp() [1/2]
spherical linear interpolates between the two quaternions
- Parameters
-
inQuat1 | |
inQuat2 | |
inPercent | (0, 1) |
- Returns
- Quaternion
◆ slerp() [2/2]
spherical linear interpolates between the two quaternions
- Parameters
-
- Returns
- Quaternion
◆ str()
std::string nc::rotations::Quaternion::str |
( |
| ) |
const |
|
inline |
returns the quaternion as a string representation
- Returns
- std::string
◆ toDCM()
NdArray< double > nc::rotations::Quaternion::toDCM |
( |
| ) |
const |
|
inline |
◆ toNdArray()
NdArray< double > nc::rotations::Quaternion::toNdArray |
( |
| ) |
const |
|
inline |
◆ xRotation()
static Quaternion nc::rotations::Quaternion::xRotation |
( |
double |
inAngle | ) |
|
|
inlinestaticnoexcept |
returns a quaternion to rotate about the x-axis by the input angle
- Parameters
-
- Returns
- Quaternion
◆ yaw()
double nc::rotations::Quaternion::yaw |
( |
| ) |
const |
|
inlinenoexcept |
The euler yaw angle in radians
- Returns
- euler yaw angle in radians
◆ yawRotation()
static Quaternion nc::rotations::Quaternion::yawRotation |
( |
double |
inAngle | ) |
|
|
inlinestaticnoexcept |
returns a quaternion to rotate about the yaw axis
- Parameters
-
- Returns
- Quaternion
◆ yRotation()
static Quaternion nc::rotations::Quaternion::yRotation |
( |
double |
inAngle | ) |
|
|
inlinestaticnoexcept |
returns a quaternion to rotate about the y-axis by the input angle
- Parameters
-
- Returns
- Quaternion
◆ zRotation()
static Quaternion nc::rotations::Quaternion::zRotation |
( |
double |
inAngle | ) |
|
|
inlinestaticnoexcept |
returns a quaternion to rotate about the y-axis by the input angle
- Parameters
-
- Returns
- Quaternion
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
inOStream, |
|
|
const Quaternion & |
inQuat |
|
) |
| |
|
friend |
IO operator for the Quaternion class
- Parameters
-
- Returns
- std::ostream&
The documentation for this class was generated from the following file: