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)
 

Data Fields

float x
 
float y
 
float z
 
float w
 

Detailed Description

Simple representation of a quaternion representing a rotation.

Constructor & Destructor Documentation

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

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

float norm ( )

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

void normalise ( )

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

static KudanMatrix3 quaternionToRotation ( KudanQuaternion q)
static

A function to convert from a quaternion to a rotation matrix

Parameters
qThe input quaternion
Returns
a KudanMatrix3 rotation matrix
KudanMatrix3 toRotation ( )

Turns this quaternion into a rotation matrix

Returns
a KudanMatrix3 rotation matrix representing the same rotation as this
std::string toString ( )

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

Returns
A string representation of this quaternion
void zero ( )

Set the all coefficients to zero

Field Documentation

float x

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


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