GEL  2
GEL is a library for Geometry and Linear Algebra
Public Member Functions | Public Attributes
CGLA::ArithQuat< T, V, Q > Class Template Reference

A T based Quaterinion class. More...

#include <ArithQuat.h>

List of all members.

Public Member Functions

 ArithQuat ()
 Construct undefined quaternion.
 ArithQuat (const V &imaginary, T real=1.0f)
 Construct quaternion from vector and scalar.
 ArithQuat (T x, T y, T z, T _qw)
 Construct quaternion from four scalars.
void set (const V &imaginary, T real=1.0f)
 Assign values to a quaternion.
void set (T x, T y, T z, T _qw)
void get (T &x, T &y, T &z, T &_qw) const
 Get values from a quaternion.
V get_imaginary_part () const
 Get imaginary part of a quaternion.
T get_real_part () const
 Get real part of a quaternion.
void get_rot (T &angle, V &v)
 Obtain angle of rotation and axis.
void make_rot (T angle, const V &v)
 Construct a Quaternion from an angle and axis of rotation.
void make_rot (const V &s, const V &t)
template<class VT , class MT , unsigned int ROWS>
void make_rot (ArithSqMatFloat< VT, MT, ROWS > &m)
 Construct a Quaternion from a rotation matrix.
bool operator== (const ArithQuat< T, V, Q > &q) const
bool operator!= (const ArithQuat< T, V, Q > &q) const
Q operator* (const ArithQuat< T, V, Q > &q) const
 Multiply two quaternions. (Combine their rotation)
Q operator* (T scalar) const
 Multiply scalar onto quaternion.
Q operator+ (const ArithQuat< T, V, Q > &q) const
 Add two quaternions.
Q operator- () const
 Compute the additive inverse of the quaternion.
T norm () const
 Compute norm of quaternion.
Q conjugate () const
 Return conjugate quaternion.
Q inverse () const
 Compute the multiplicative inverse of the quaternion.
Q normalize ()
 Normalize quaternion.
V apply (const V &vec) const
 Rotate vector according to quaternion.
V apply_unit (const V &vec) const
 Rotate vector according to unit quaternion.

Public Attributes

V qv
 Vector part of quaternion.
T qw
 Scalar part of quaternion.

Detailed Description

template<class T, class V, class Q>
class CGLA::ArithQuat< T, V, Q >

A T based Quaterinion class.

Quaternions are algebraic entities useful for rotation.


Member Function Documentation

template<class T, class V, class Q>
void CGLA::ArithQuat< T, V, Q >::make_rot ( const V &  s,
const V &  t 
) [inline]

Construct a Quaternion rotating from the direction given by the first argument to the direction given by the second.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations