Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WFMath::Quaternion Class Reference

A normalized quaterion. More...

#include <quaternion.h>

List of all members.

Public Member Functions

 Quaternion ()
 Construct a Quatertion.

 Quaternion (const CoordType w_in, const CoordType x_in, const CoordType y_in, const CoordType z_in)
 Construct a Quaternion from (w, x, y, z) components.

 Quaternion (int axis, const CoordType angle)
 Construct a Quaternion giving a rotation around axis by angle.

 Quaternion (const Vector< 3 > &axis, const CoordType angle)
 Construct a Quaternion giving a rotation around the Vector axis by angle.

 Quaternion (const Vector< 3 > &axis)
 Construct a Quaternion giving a rotation around the Vector axis.

 Quaternion (const Quaternion &p)
 Construct a copy of a Quaternion.

 Quaternion (const Atlas::Message::Object &a)
 Construct a Quaternion from an Atlas::Message::Object.

Atlas::Message::Object toAtlas () const
 Create an Atlas object from the Quaternion.

void fromAtlas (const Atlas::Message::Object &a)
 Set the Quaternion's value to that given by an Atlas object.

Quaternion & identity ()
 Set the Quaternion to the identity rotation.

bool fromRotMatrix (const RotMatrix< 3 > &m)
 set a Quaternion's value from a RotMatrix

Quaternion inverse () const
 returns the inverse of the Quaternion

Quaternion & rotation (int axis, const CoordType angle)
 sets the Quaternion to a rotation by angle around axis

Quaternion & rotation (const Vector< 3 > &axis, const CoordType angle)
 sets the Quaternion to a rotation by angle around the Vector axis

Quaternion & rotation (const Vector< 3 > &axis)
 sets the Quaternion to a rotation around the Vector axis

CoordType scalar () const
 returns the scalar (w) part of the Quaternion

const Vector< 3 > & vector () const
 returns the Vector (x, y, z) part of the quaternion


Detailed Description

A normalized quaterion.

This class implements the 'generic' subset of the interface in the fake class Shape.


Constructor & Destructor Documentation

WFMath::Quaternion::Quaternion const CoordType    w_in,
const CoordType    x_in,
const CoordType    y_in,
const CoordType    z_in
 

Construct a Quaternion from (w, x, y, z) components.

This normalizes the components so the sum of their squares is one.

WFMath::Quaternion::Quaternion const Vector< 3 > &    axis [inline]
 

Construct a Quaternion giving a rotation around the Vector axis.

The angle of rotating is equal to the magnitude of the Vector


Member Function Documentation

bool WFMath::Quaternion::fromRotMatrix const RotMatrix< 3 > &    m
 

set a Quaternion's value from a RotMatrix

Since a Quaternion can only represent an even-parity RotMatrix, this function returns false if the parity of m is odd. In this case, the quaternion is set to the value of m multiplied by a fixed parity-odd RotMatrix, so the full RotMatrix can be recovered by passing the Quaternion and the value of 'not_flip' returned by this function to RotMatrix::fromQuaternion().

Quaternion& WFMath::Quaternion::rotation const Vector< 3 > &    axis
 

sets the Quaternion to a rotation around the Vector axis

The rotation angle is given by the magnitude of the Vector


The documentation for this class was generated from the following files:
Generated on Wed May 28 09:20:34 2003 for WFMath by doxygen1.3-rc3