My Project
Public Member Functions | Public Attributes | List of all members
Quaternion Class Reference

#include <geometry.h>

Public Member Functions

 Quaternion (void)
 
 Quaternion (double r, const Point3D &i)
 
 Quaternion (const Matrix3D &rot)
 
 Quaternion (const Matrix3D &rot, const Quaternion &quat)
 
 Quaternion (const Point3D &eulerAngle, const Quaternion &quat)
 
double dot (const Quaternion &q) const
 
double length (void) const
 
double squareNorm (void) const
 
Quaternion unit (void) const
 
Quaternion operator- (void) const
 
Quaternion conjugate (void) const
 
Quaternion invert (void) const
 
Quaternion operator* (double scale) const
 
Quaternionoperator*= (double scale)
 
Quaternion operator/ (double scale) const
 
Quaternionoperator/= (double scale)
 
Quaternion operator+ (const Quaternion &q) const
 
Quaternionoperator+= (const Quaternion &q)
 
Quaternion operator- (const Quaternion &q) const
 
Quaternionoperator-= (const Quaternion &q)
 
Quaternion operator* (const Quaternion &q) const
 
Quaternionoperator*= (const Quaternion &q)
 
Quaternion operator/ (const Quaternion &q) const
 
Quaternionoperator/= (const Quaternion &q)
 

Public Attributes

double real
 
Point3D imag
 

Detailed Description

This class represents a quaternion

Constructor & Destructor Documentation

Quaternion::Quaternion ( void  )

This constructor generates the identity quaternion.

Quaternion::Quaternion ( double  r,
const Point3D i 
)

This constructor generates a quaternion with real value r and imaginary components i.

Quaternion::Quaternion ( const Matrix3D rot)

This constructor generates a quaternion corresponding to the 3x3 rotation matrix.

Quaternion::Quaternion ( const Matrix3D rot,
const Quaternion quat 
)

Because the quaternion of a rotation is unique up to sign, the following method sets the quaternion so that it is closest to the input ones

Quaternion::Quaternion ( const Point3D eulerAngle,
const Quaternion quat 
)

Because the quaternion of a rotation is unique up to sign, the following method sets the quaternion so that it is closest to the input ones

Member Function Documentation

Quaternion Quaternion::conjugate ( void  ) const

This method returns the complex conjugate of a quaternion

double Quaternion::dot ( const Quaternion q) const

This method returns the dot product of two quaternions.

Quaternion Quaternion::invert ( void  ) const

This method returns the reciprocal of a quaternion.

double Quaternion::length ( void  ) const

This method returns the length of a quaternion.

Quaternion Quaternion::operator* ( double  scale) const

This method scales a quaternion by a constant factor and returns a new quaternion.

Quaternion Quaternion::operator* ( const Quaternion q) const

This method returns the product of two quaternions.

Quaternion & Quaternion::operator*= ( double  scale)

This method scales the current quaternion by a constant factor.

Quaternion & Quaternion::operator*= ( const Quaternion q)

This method multiplies the current quaternion by another quaternion.

Quaternion Quaternion::operator+ ( const Quaternion q) const

This method adds two quaternion and returns their sum.

Quaternion & Quaternion::operator+= ( const Quaternion q)

This method adds a point to the current quaternion.

Quaternion Quaternion::operator- ( void  ) const

This method return the negative of the quaternion.

Quaternion Quaternion::operator- ( const Quaternion q) const

This method subtracts two quaternion and returns their difference.

Quaternion & Quaternion::operator-= ( const Quaternion q)

This method subtracts a quaternion from the current quaternion.

Quaternion Quaternion::operator/ ( double  scale) const

This method divides the coefficients of a quaternion by a constant factor and returns a new quaternion.

Quaternion Quaternion::operator/ ( const Quaternion q) const

This method returns the quotient of two quaternions.

Quaternion & Quaternion::operator/= ( double  scale)

This method divides the coefficients of the current quaternion by a constant factor.

Quaternion & Quaternion::operator/= ( const Quaternion q)

This method divides the current quaternion by another quaternion.

double Quaternion::squareNorm ( void  ) const

This method returns the square of the length of a quaternion.

Quaternion Quaternion::unit ( void  ) const

This method returns a unit vector that points in the same direction as the quaternion.

Member Data Documentation

Point3D Quaternion::imag

The imaginary components of the quaternion

double Quaternion::real

The real component of the quaternion


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