vrmlproc & togeom
 
Loading...
Searching...
No Matches
vrml_proc::math::Quaternion Struct Reference

Class representing quaternion object. The quaternion is number system that extends the complex numbers. Quaternions are used for calculations involving three-dimensional rotations,. More...

#include <Quaternion.hpp>

Public Member Functions

 Quaternion ()
 Constructs default quaternion.
 
 Quaternion (double x, double y, double z, const vrml_proc::math::Angle &angle)
 Constructs quaternion.
 
Quaternion operator* (const Quaternion &second) const
 Overloaded operator for multiplying quaternions.
 
bool IsNormalized () const
 Checks if the quaternion is normalized.
 
void Normalize ()
 Normalized the quaternion.
 
void Inverse ()
 Inverses the quaternion.
 

Public Attributes

double x
 Publicly available values. Note that value w is in radians!
 
double y
 
double z
 
double w
 

Detailed Description

Class representing quaternion object. The quaternion is number system that extends the complex numbers. Quaternions are used for calculations involving three-dimensional rotations,.

Note
The main resource for this topic was https://www.cprogramming.com/tutorial/3d/quaternions.html.
Todo
Values x, y, z and w should be private and getters and setters shouls be made!

Constructor & Destructor Documentation

◆ Quaternion()

vrml_proc::math::Quaternion::Quaternion ( double x,
double y,
double z,
const vrml_proc::math::Angle & angle )
inline

Constructs quaternion.

Parameters
xx value
yy value
zz value
anglew value representing angle

Member Function Documentation

◆ Inverse()

void vrml_proc::math::Quaternion::Inverse ( )
inline

Inverses the quaternion.

Warning
Make sure that quaternion is not zero-norm!
Note
Link: https://www.mathworks.com/help/aeroblks/quaternioninverse.html.

◆ IsNormalized()

bool vrml_proc::math::Quaternion::IsNormalized ( ) const
inline

Checks if the quaternion is normalized.

Returns
true if quaterniion is normalized, otherwise false

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