OpenStructure
Public Member Functions | Data Fields
Quat Class Reference

#include <quat.hh>

Inherits additive< Quat >, multiplicative< Quat, Real >, and multiplicative< Quat, Quat >.

Public Member Functions

 Quat ()
 
 Quat (Real w, Real x, Real y, Real z)
 
 Quat (Real angle, const geom::Vec3 &axis)
 
 Quat (const Mat3 &rotmat)
 
Mat3 ToRotationMatrix () const
 
Vec3 GetAxis () const
 
Real GetAngle () const
 
Quat operator- ()
 
Quatoperator+= (const Quat &q)
 
Quatoperator-= (const Quat &q)
 
Quatoperator*= (Real s)
 
Quatoperator*= (const Quat &q)
 
Quatoperator/= (Real s)
 
Quatoperator/= (const Quat &q)
 
bool operator== (const Quat &q) const
 
bool operator!= (const Quat &q) const
 
Vec3 Rotate (const Vec3 &vec) const
 

Data Fields

Real w
 
Real x
 
Real y
 
Real z
 

Detailed Description

unit quaternion

The four components of a unit quaternion can be seen as [cos(theta),sin(theta)*x,sin(theta)*y,sin(theta)*z], where (x,y,z) constitute the unit vector of the rotation axis, and theta the half-rotation angle around that axis.

Definition at line 54 of file quat.hh.

Constructor & Destructor Documentation

◆ Quat() [1/4]

Quat ( )

◆ Quat() [2/4]

Quat ( Real  w,
Real  x,
Real  y,
Real  z 
)

◆ Quat() [3/4]

Quat ( Real  angle,
const geom::Vec3 axis 
)

◆ Quat() [4/4]

Quat ( const Mat3 rotmat)

Member Function Documentation

◆ GetAngle()

Real GetAngle ( ) const

◆ GetAxis()

Vec3 GetAxis ( ) const

◆ operator!=()

bool operator!= ( const Quat q) const
inline

Definition at line 96 of file quat.hh.

◆ operator*=() [1/2]

Quat& operator*= ( const Quat q)

◆ operator*=() [2/2]

Quat& operator*= ( Real  s)

◆ operator+=()

Quat& operator+= ( const Quat q)

◆ operator-()

Quat operator- ( )

◆ operator-=()

Quat& operator-= ( const Quat q)

◆ operator/=() [1/2]

Quat& operator/= ( const Quat q)

◆ operator/=() [2/2]

Quat& operator/= ( Real  s)

◆ operator==()

bool operator== ( const Quat q) const

◆ Rotate()

Vec3 Rotate ( const Vec3 vec) const

◆ ToRotationMatrix()

Mat3 ToRotationMatrix ( ) const

Field Documentation

◆ w

Real w

Definition at line 103 of file quat.hh.

◆ x

Real x

Definition at line 103 of file quat.hh.

◆ y

Real y

Definition at line 103 of file quat.hh.

◆ z

Real z

Definition at line 103 of file quat.hh.


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