Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ObjCryst::Quaternion Class Reference

A quaternion class, used to represent the orientation of the molecule. More...

List of all members.

Public Member Functions

 Quaternion ()
 Default constructor, yields q=(1,0,0,0).

 Quaternion (const REAL q0, const REAL q1, const REAL q2, const REAL q3, bool unit=true)
 Creates a unit quaternion from its components (normalized automatically).

 ~Quaternion ()
Quaternion GetConjugate () const
 Get the conjugate of this quaternion (== the inverse if unit quaternion).

Quaternion operator * (const Quaternion &q) const
 Quaternion multiplication.

void operator *= (const Quaternion &q)
void XMLOutput (ostream &os, int indent=0) const
void XMLInput (istream &is, const XMLCrystTag &tag)
void RotateVector (REAL &v1, REAL &v2, REAL &v3) const
 Rotate vector v=(v1,v2,v3). The rotated components are directly written.

void Normalize ()
 Re-normalize the quaternion to unity.

REAL GetNorm () const
const REAL & Q0 () const
const REAL & Q1 () const
const REAL & Q2 () const
const REAL & Q3 () const
REAL & Q0 ()
REAL & Q1 ()
REAL & Q2 ()
REAL & Q3 ()

Static Public Member Functions

Quaternion RotationQuaternion (const REAL ang, const REAL v1, const REAL v2, const REAL v3)
 Create a rotation quaternion around a given vector for a given angle.


Private Attributes

REAL mQ0
 The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

REAL mQ1
 The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

REAL mQ2
 The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

REAL mQ3
 The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

bool mIsUniQuaternion


Detailed Description

A quaternion class, used to represent the orientation of the molecule.

It may or may not be a unit quaternion.


Constructor & Destructor Documentation

ObjCryst::Quaternion::Quaternion  ) 
 

Default constructor, yields q=(1,0,0,0).

ObjCryst::Quaternion::Quaternion const REAL  q0,
const REAL  q1,
const REAL  q2,
const REAL  q3,
bool  unit = true
 

Creates a unit quaternion from its components (normalized automatically).

ObjCryst::Quaternion::~Quaternion  ) 
 


Member Function Documentation

Quaternion ObjCryst::Quaternion::GetConjugate  )  const
 

Get the conjugate of this quaternion (== the inverse if unit quaternion).

REAL ObjCryst::Quaternion::GetNorm  )  const
 

void ObjCryst::Quaternion::Normalize  ) 
 

Re-normalize the quaternion to unity.

This should not be useful, except on individual component input, or after long calculations. And even if wrong, the rotation is independent of the norm of the quaternion.

Quaternion ObjCryst::Quaternion::operator * const Quaternion q  )  const
 

Quaternion multiplication.

void ObjCryst::Quaternion::operator *= const Quaternion q  ) 
 

REAL& ObjCryst::Quaternion::Q0  ) 
 

const REAL& ObjCryst::Quaternion::Q0  )  const
 

REAL& ObjCryst::Quaternion::Q1  ) 
 

const REAL& ObjCryst::Quaternion::Q1  )  const
 

REAL& ObjCryst::Quaternion::Q2  ) 
 

const REAL& ObjCryst::Quaternion::Q2  )  const
 

REAL& ObjCryst::Quaternion::Q3  ) 
 

const REAL& ObjCryst::Quaternion::Q3  )  const
 

void ObjCryst::Quaternion::RotateVector REAL &  v1,
REAL &  v2,
REAL &  v3
const
 

Rotate vector v=(v1,v2,v3). The rotated components are directly written.

Quaternion ObjCryst::Quaternion::RotationQuaternion const REAL  ang,
const REAL  v1,
const REAL  v2,
const REAL  v3
[static]
 

Create a rotation quaternion around a given vector for a given angle.

void ObjCryst::Quaternion::XMLInput istream &  is,
const XMLCrystTag tag
 

void ObjCryst::Quaternion::XMLOutput ostream &  os,
int  indent = 0
const
 


Member Data Documentation

bool ObjCryst::Quaternion::mIsUniQuaternion [private]
 

REAL ObjCryst::Quaternion::mQ0 [private]
 

The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

REAL ObjCryst::Quaternion::mQ1 [private]
 

The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

REAL ObjCryst::Quaternion::mQ2 [private]
 

The components of the quaternion z=(q0,v) with v=(q1,q2,q3).

REAL ObjCryst::Quaternion::mQ3 [private]
 

The components of the quaternion z=(q0,v) with v=(q1,q2,q3).


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:03:59 2006 for ObjCryst++ by doxygen 1.3.6