WPILibC++ 2023.4.3-108-ge5452e3
frc::Quaternion Class Reference

#include <frc/geometry/Quaternion.h>

Public Member Functions

 Quaternion ()=default
 Constructs a quaternion with a default angle of 0 degrees. More...
 
 Quaternion (double w, double x, double y, double z)
 Constructs a quaternion with the given components. More...
 
Quaternion operator* (const Quaternion &other) const
 Multiply with another quaternion. More...
 
bool operator== (const Quaternion &other) const
 Checks equality between this Quaternion and another object. More...
 
Quaternion Inverse () const
 Returns the inverse of the quaternion. More...
 
Quaternion Normalize () const
 Normalizes the quaternion. More...
 
double W () const
 Returns W component of the quaternion. More...
 
double X () const
 Returns X component of the quaternion. More...
 
double Y () const
 Returns Y component of the quaternion. More...
 
double Z () const
 Returns Z component of the quaternion. More...
 
Eigen::Vector3d ToRotationVector () const
 Returns the rotation vector representation of this quaternion. More...
 

Constructor & Destructor Documentation

◆ Quaternion() [1/2]

frc::Quaternion::Quaternion ( )
default

Constructs a quaternion with a default angle of 0 degrees.

◆ Quaternion() [2/2]

frc::Quaternion::Quaternion ( double  w,
double  x,
double  y,
double  z 
)

Constructs a quaternion with the given components.

Parameters
wW component of the quaternion.
xX component of the quaternion.
yY component of the quaternion.
zZ component of the quaternion.

Member Function Documentation

◆ Inverse()

Quaternion frc::Quaternion::Inverse ( ) const

Returns the inverse of the quaternion.

◆ Normalize()

Quaternion frc::Quaternion::Normalize ( ) const

Normalizes the quaternion.

◆ operator*()

Quaternion frc::Quaternion::operator* ( const Quaternion other) const

Multiply with another quaternion.

Parameters
otherThe other quaternion.

◆ operator==()

bool frc::Quaternion::operator== ( const Quaternion other) const

Checks equality between this Quaternion and another object.

Parameters
otherThe other object.
Returns
Whether the two objects are equal.

◆ ToRotationVector()

Eigen::Vector3d frc::Quaternion::ToRotationVector ( ) const

Returns the rotation vector representation of this quaternion.

This is also the log operator of SO(3).

◆ W()

double frc::Quaternion::W ( ) const

Returns W component of the quaternion.

◆ X()

double frc::Quaternion::X ( ) const

Returns X component of the quaternion.

◆ Y()

double frc::Quaternion::Y ( ) const

Returns Y component of the quaternion.

◆ Z()

double frc::Quaternion::Z ( ) const

Returns Z component of the quaternion.


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