irtkQuaternion Class Reference

#include <irtkQuaternion.h>

Inheritance diagram for irtkQuaternion:

Inheritance graph
[legend]
Collaboration diagram for irtkQuaternion:

Collaboration graph
[legend]

List of all members.


Detailed Description

Represents a quaternion.

Definition at line 21 of file irtkQuaternion.h.


Public Member Functions

 irtkQuaternion ()
 Default constructor creates a quaternion with components (0, 0, 0, 0).
 irtkQuaternion (double t, double u, double v, double w)
 Constructor creates a quaternion with components (t, u, v, w).
 irtkQuaternion (const irtkQuaternion &q)
 Copy constructor.
irtkQuaternionoperator= (const irtkQuaternion &q)
 Assignment operator.
irtkQuaternion Conjugate () const
 Returns the conjugate of a quaternion.
irtkQuaternion Inverse () const
 Returns the inverse of the quaternion.
void Normalize ()
 Normalizes the quaternion.
double Length () const
 Returns the length of the quaternion.
irtkMatrix ComputeRotationMatrix () const
 Computes the rotation matrix corresponding to this quaternion.
virtual const char * NameOfClass ()
 Returns the name of the class.

Static Public Member Functions

static irtkMatrix ComputeTransformationMatrix (double alpha, double u, double v, double w, double ox, double oy, double oz)
 Computes the rotation matrix needed to a rotate a point by an angle alpha about the axis with direction (u, v, w) passing through the point (ox, oy, oz).
static irtkMatrix ComputeRotationMatrix (double alpha, double u, double v, double w)
 Computes the rotation matrix needed to rotate a point by an angle alpha about the axis with direction (u, v, w) passing through the origin.
static irtkQuaternion ComputeRotationQuaternion (double alpha, double u, double v, double w)
 Computes the quaternion which represents a rotation by an angle alpha about the axis with direction (u, v, w) passing through the origin.

Public Attributes

double _t
 The real part of the quaternion.
double _u
 The first imaginary part.
double _v
 The second imaginary part.
double _w
 The third imaginary part.

Friends

irtkQuaternion operator+ (const irtkQuaternion &a, const irtkQuaternion &b)
 Adds two quaternions.
irtkQuaternion operator- (const irtkQuaternion &a, const irtkQuaternion &b)
 Subtracts two quaternions.
irtkQuaternion operator * (const irtkQuaternion &a, const irtkQuaternion &b)
 Multiplies two quaternions.
irtkQuaternion operator * (const irtkQuaternion &a, double b)
 Multiplies a quaternion by a real number.
ostream & operator<< (ostream &os, const irtkQuaternion &q)
 Outputs the quaternion.

Constructor & Destructor Documentation

irtkQuaternion::irtkQuaternion (  )  [inline]

Default constructor creates a quaternion with components (0, 0, 0, 0).

Definition at line 105 of file irtkQuaternion.h.

References _t, _u, _v, and _w.

irtkQuaternion::irtkQuaternion ( double  t,
double  u,
double  v,
double  w 
) [inline]

Constructor creates a quaternion with components (t, u, v, w).

Definition at line 113 of file irtkQuaternion.h.

References _t, _u, _v, and _w.

irtkQuaternion::irtkQuaternion ( const irtkQuaternion q  )  [inline]

Copy constructor.

Definition at line 121 of file irtkQuaternion.h.

References _t, _u, _v, and _w.


Member Function Documentation

irtkQuaternion & irtkQuaternion::operator= ( const irtkQuaternion q  )  [inline]

Assignment operator.

Definition at line 129 of file irtkQuaternion.h.

References _t, _u, _v, and _w.

irtkQuaternion irtkQuaternion::Conjugate (  )  const [inline]

Returns the conjugate of a quaternion.

Definition at line 196 of file irtkQuaternion.h.

References _t, _u, _v, and _w.

Referenced by Inverse().

irtkQuaternion irtkQuaternion::Inverse (  )  const [inline]

Returns the inverse of the quaternion.

Definition at line 208 of file irtkQuaternion.h.

References Conjugate(), and Length().

void irtkQuaternion::Normalize (  )  [inline]

Normalizes the quaternion.

Definition at line 218 of file irtkQuaternion.h.

References _t, _u, _v, _w, and Length().

double irtkQuaternion::Length (  )  const [inline]

Returns the length of the quaternion.

Definition at line 230 of file irtkQuaternion.h.

References _t, _u, _v, and _w.

Referenced by Inverse(), and Normalize().

irtkMatrix irtkQuaternion::ComputeRotationMatrix (  )  const

Computes the rotation matrix corresponding to this quaternion.

Note that the matrix is a 4x4 homogeneous matrix.

static irtkMatrix irtkQuaternion::ComputeTransformationMatrix ( double  alpha,
double  u,
double  v,
double  w,
double  ox,
double  oy,
double  oz 
) [static]

Computes the rotation matrix needed to a rotate a point by an angle alpha about the axis with direction (u, v, w) passing through the point (ox, oy, oz).

The direction of rotation is the direction a right-handed corkscrew needs to be rotated in order to move along the direction of the axis. Note that the matrix returned is a 4x4 homogeneous matrix.

static irtkMatrix irtkQuaternion::ComputeRotationMatrix ( double  alpha,
double  u,
double  v,
double  w 
) [static]

Computes the rotation matrix needed to rotate a point by an angle alpha about the axis with direction (u, v, w) passing through the origin.

Direction of rotation is direction a right-handed corkscrew needs to be rotated in order to move along direction of axis. Note that the rotation matrix is a 4x4 homogeneous matrix.

static irtkQuaternion irtkQuaternion::ComputeRotationQuaternion ( double  alpha,
double  u,
double  v,
double  w 
) [static]

Computes the quaternion which represents a rotation by an angle alpha about the axis with direction (u, v, w) passing through the origin.

Direction of rotation is direction a right-handed corkscrew needs to be rotated in order to move along direction of axis.

const char * irtkQuaternion::NameOfClass (  )  [inline, virtual]

Returns the name of the class.

Definition at line 235 of file irtkQuaternion.h.


Friends And Related Function Documentation

irtkQuaternion operator+ ( const irtkQuaternion a,
const irtkQuaternion b 
) [friend]

Adds two quaternions.

Definition at line 141 of file irtkQuaternion.h.

irtkQuaternion operator- ( const irtkQuaternion a,
const irtkQuaternion b 
) [friend]

Subtracts two quaternions.

Definition at line 153 of file irtkQuaternion.h.

irtkQuaternion operator * ( const irtkQuaternion a,
const irtkQuaternion b 
) [friend]

Multiplies two quaternions.

Definition at line 165 of file irtkQuaternion.h.

irtkQuaternion operator * ( const irtkQuaternion a,
double  b 
) [friend]

Multiplies a quaternion by a real number.

Definition at line 177 of file irtkQuaternion.h.

ostream& operator<< ( ostream &  os,
const irtkQuaternion q 
) [friend]

Outputs the quaternion.

Definition at line 189 of file irtkQuaternion.h.


Member Data Documentation

The real part of the quaternion.

Definition at line 25 of file irtkQuaternion.h.

Referenced by Conjugate(), irtkQuaternion(), Length(), Normalize(), and operator=().

The first imaginary part.

Definition at line 28 of file irtkQuaternion.h.

Referenced by Conjugate(), irtkQuaternion(), Length(), Normalize(), and operator=().

The second imaginary part.

Definition at line 31 of file irtkQuaternion.h.

Referenced by Conjugate(), irtkQuaternion(), Length(), Normalize(), and operator=().

The third imaginary part.

Definition at line 34 of file irtkQuaternion.h.

Referenced by Conjugate(), irtkQuaternion(), Length(), Normalize(), and operator=().


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