Quaternion Class Reference

#include <ZLinAlg.h>

List of all members.


Detailed Description

A class of quaternions and a number of linear algebra methods and operators.


Public Member Functions

 Quaternion ()
 ~Quaternion ()
float getX ()
float getY ()
float getZ ()
float getW ()
void setvalues (float X, float Y, float Z, float W)
void setX (float X)
void setY (float Y)
void setZ (float Z)
void setW (float W)
float norm ()
bool normalize ()
bool conjugate ()
bool ComputeFromRotationMatrix (Column3Vector C0, Column3Vector C1, Column3Vector C2)
Column3Vector RotateVector (Column3Vector P1)
Quaternion operator * (Quaternion Qright)
Quaternion operator/ (Quaternion Qright)
Quaternionoperator= (Quaternion Qnew)
void PrintSelf ()


Constructor & Destructor Documentation

Quaternion::Quaternion  ) 
 

Constructor Class.

Returns:
none.

Quaternion::~Quaternion  ) 
 

Destructor Class

Returns:


Member Function Documentation

bool Quaternion::ComputeFromRotationMatrix Column3Vector  C0,
Column3Vector  C1,
Column3Vector  C2
 

Compute quaternion elements from a rotation matrix. NOTE: The matrix columns should be orthonormal. This is not verified prior to computing the quaternion.

Parameters:
C0 First column vector of the rotation matrix.
C1 Second column vector of the rotation matrix.
C2 Third column vector of the rotation matrix.
Returns:
true if success, false if the quaternion cannot be computed.

bool Quaternion::conjugate  ) 
 

float Quaternion::getW  ) 
 

Get fourth element of the quaternion.

Returns:
The scalar constant for the quaternion.

float Quaternion::getX  ) 
 

Get first element of the quaternion.

Returns:
The x-coefficient for the quaternion.

float Quaternion::getY  ) 
 

Get second element of the quaternion.

Returns:
The y-coefficient for the quaternion.

float Quaternion::getZ  ) 
 

Get third element of the quaternion.

Returns:
The z-coefficient for the quaternion.

float Quaternion::norm  ) 
 

Compute the norm of the 3-vector.

Returns:
The norm of the 3-vector.

bool Quaternion::normalize  ) 
 

Normalize the quaternion.

Returns:
True if successfully normalized, false if quaternion cannot be normalized.

Quaternion Quaternion::operator * Quaternion  Qright  ) 
 

Multiply two quaternions.

Parameters:
Qright The righthand multiplier.
Returns:
The result.

Quaternion Quaternion::operator/ Quaternion  Qright  ) 
 

Find relative rotation between two frames represented by two quaternions. Rotation multiplied by rotation inverse.

Parameters:
Qright 
Returns:
Result.

Quaternion & Quaternion::operator= Quaternion  Qnew  ) 
 

Method for quaternion assignment operator.

Parameters:
Qnew The new quaternion to be assigned.
Returns:
Result.

void Quaternion::PrintSelf  ) 
 

Print the contents of the quaternion vector to the console.

Column3Vector Quaternion::RotateVector Column3Vector  P1  ) 
 

Rotate a vector using a quaternion representation of that rotation.

Parameters:
P1 The vector to be rotated.
Returns:

void Quaternion::setvalues float  X,
float  Y,
float  Z,
float  W
 

Set all the quaternion vector elements.

Parameters:
X X element.
Y Y element.
Z Z element.
W Real element.

void Quaternion::setW float  W  ) 
 

Set the W element (real).

Parameters:
W Desired value of W element (real).

void Quaternion::setX float  X  ) 
 

Set the X element.

Parameters:
X Desired value of X element.

void Quaternion::setY float  Y  ) 
 

Set the Y element.

Parameters:
Y Desired value of Y element.

void Quaternion::setZ float  Z  ) 
 

Set the Z element.

Parameters:
Z Desired value of Z element.


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:27:15 2007 for NaviTrack by  doxygen 1.4.6