KudanCV
KudanQuaternion Class Reference

#include <KudanCV.h>

Public Member Functions

 KudanQuaternion ()
 
 KudanQuaternion (float x, float y, float z, float w)
 
void zero ()
 
KudanMatrix3 toRotation ()
 
std::string toString ()
 
float norm ()
 
void normalise ()
 

Static Public Member Functions

static KudanMatrix3 quaternionToRotation (KudanQuaternion &q)
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Detailed Description

Simple representation of a quaternion representing a rotation.

Constructor & Destructor Documentation

◆ KudanQuaternion() [1/2]

KudanQuaternion::KudanQuaternion ( )

Default constructor initialises the data to the zero quaternion (0,0,0,0)'

◆ KudanQuaternion() [2/2]

KudanQuaternion::KudanQuaternion ( float  x,
float  y,
float  z,
float  w 
)

Constructor for initialising the data to the given quaternion. Careful of the order: x, y, z, w

Parameters
x,y,z,wCoefficients of the quaternion

Member Function Documentation

◆ norm()

float KudanQuaternion::norm ( )

Get the norm of this Quaternion (should usually be 1). This is the Euclidean/L2 norm of the 4-vector representing the quaternion

◆ normalise()

void KudanQuaternion::normalise ( )

Normalises this quaternion (so it is a 4-vector with Euclidean/L2 norm 1)

◆ quaternionToRotation()

KudanMatrix3 KudanQuaternion::quaternionToRotation ( KudanQuaternion q)
static

A function to convert from a quaternion to a rotation matrix

Parameters
qThe input quaternion
Returns
a KudanMatrix3 rotation matrix

◆ toRotation()

KudanMatrix3 KudanQuaternion::toRotation ( )

Turns this quaternion into a rotation matrix

Returns
a KudanMatrix3 rotation matrix representing the same rotation as this

◆ toString()

std::string KudanQuaternion::toString ( )

Returns a representation of this as a string (x,y,z;w)

Returns
A string representation of this quaternion

◆ zero()

void KudanQuaternion::zero ( )

Set the all coefficients to zero

Member Data Documentation

◆ x

float KudanQuaternion::x

Public x, y, z, w coefficients of the quaternion


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