All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GfQuatd Class Reference

Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients, stored as a 3-vector. More...

Public Types

typedef double ScalarType
 
typedef GfVec3d ImaginaryType
 

Public Member Functions

 GfQuatd ()
 Default constructor leaves the quaternion undefined. More...
 
 GfQuatd (double realVal)
 Initialize the real coefficient to realVal and the imaginary coefficients to zero. More...
 
 GfQuatd (double real, double i, double j, double k)
 Initialize the real and imaginary coefficients. More...
 
 GfQuatd (double real, const GfVec3d &imaginary)
 Initialize the real and imaginary coefficients. More...
 
GF_API GfQuatd (class GfQuatf const &other)
 Implicitly convert from GfQuatf. More...
 
GF_API GfQuatd (class GfQuath const &other)
 Implicitly convert from GfQuath. More...
 
double GetReal () const
 Return the real coefficient. More...
 
void SetReal (double real)
 Set the real coefficient. More...
 
const GfVec3dGetImaginary () const
 Return the imaginary coefficient. More...
 
void SetImaginary (const GfVec3d &imaginary)
 Set the imaginary coefficients. More...
 
void SetImaginary (double i, double j, double k)
 Set the imaginary coefficients. More...
 
double GetLength () const
 Return geometric length of this quaternion. More...
 
GfQuatd GetNormalized (double eps=GF_MIN_VECTOR_LENGTH) const
 length of this quaternion is smaller than eps, return the identity quaternion. More...
 
GF_API double Normalize (double eps=GF_MIN_VECTOR_LENGTH)
 Normalizes this quaternion in place to unit length, returning the length before normalization. More...
 
GfQuatd GetConjugate () const
 Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients. More...
 
GfQuatd GetInverse () const
 Return this quaternion's inverse, or reciprocal. More...
 
GfQuatd operator- () const
 Component-wise negation. More...
 
bool operator== (const GfQuatd &q) const
 Component-wise quaternion equality test. More...
 
bool operator!= (const GfQuatd &q) const
 Component-wise quaternion inequality test. More...
 
GF_API GfQuatdoperator*= (const GfQuatd &q)
 Post-multiply quaternion q into this quaternion. More...
 
GfQuatdoperator*= (double s)
 Multiply this quaternion's coefficients by s. More...
 
GfQuatdoperator/= (double s)
 Divide this quaternion's coefficients by s. More...
 
GfQuatdoperator+= (const GfQuatd &q)
 Add quaternion q to this quaternion. More...
 
GfQuatdoperator-= (const GfQuatd &q)
 Component-wise unary difference operator. More...
 

Static Public Member Functions

static GfQuatd GetIdentity ()
 Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero. More...
 

Friends

size_t hash_value (const GfQuatd &q)
 Hash. More...
 
GfQuatd operator+ (const GfQuatd &q1, const GfQuatd &q2)
 Component-wise binary sum operator. More...
 
GfQuatd operator- (const GfQuatd &q1, const GfQuatd &q2)
 Component-wise binary difference operator. More...
 
GfQuatd operator* (const GfQuatd &q1, const GfQuatd &q2)
 Returns the product of quaternions q1 and q2. More...
 
GfQuatd operator* (const GfQuatd &q, double s)
 Returns the product of quaternion q and scalar s. More...
 
GfQuatd operator* (double s, const GfQuatd &q)
 Returns the product of quaternion q and scalar s. More...
 
GfQuatd operator/ (const GfQuatd &q, double s)
 Returns the product of quaternion q and scalar 1 / s. More...
 

Detailed Description

Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients, stored as a 3-vector.

Definition at line 60 of file quatd.h.

Constructor & Destructor Documentation

GfQuatd ( )
inline

Default constructor leaves the quaternion undefined.

Definition at line 67 of file quatd.h.

GfQuatd ( double  realVal)
inlineexplicit

Initialize the real coefficient to realVal and the imaginary coefficients to zero.

Since quaternions typically must be normalized, reasonable values for realVal are -1, 0, or 1. Other values are legal but are likely to be meaningless.

Definition at line 76 of file quatd.h.

GfQuatd ( double  real,
double  i,
double  j,
double  k 
)
inline

Initialize the real and imaginary coefficients.

Definition at line 79 of file quatd.h.

GfQuatd ( double  real,
const GfVec3d imaginary 
)
inline

Initialize the real and imaginary coefficients.

Definition at line 85 of file quatd.h.

GF_API GfQuatd ( class GfQuatf const &  other)

Implicitly convert from GfQuatf.

GF_API GfQuatd ( class GfQuath const &  other)

Implicitly convert from GfQuath.

Member Function Documentation

GfQuatd GetConjugate ( ) const
inline

Return this quaternion's conjugate, which is the quaternion with the same real coefficient and negated imaginary coefficients.

Definition at line 140 of file quatd.h.

static GfQuatd GetIdentity ( )
inlinestatic

Return the identity quaternion, with real coefficient 1 and an imaginary coefficients all zero.

Definition at line 99 of file quatd.h.

const GfVec3d& GetImaginary ( ) const
inline

Return the imaginary coefficient.

Definition at line 108 of file quatd.h.

GfQuatd GetInverse ( ) const
inline

Return this quaternion's inverse, or reciprocal.

This is the quaternion's conjugate divided by it's squared length.

Definition at line 146 of file quatd.h.

double GetLength ( ) const
inline

Return geometric length of this quaternion.

Definition at line 121 of file quatd.h.

GfQuatd GetNormalized ( double  eps = GF_MIN_VECTOR_LENGTH) const
inline

length of this quaternion is smaller than eps, return the identity quaternion.

Definition at line 126 of file quatd.h.

double GetReal ( ) const
inline

Return the real coefficient.

Definition at line 102 of file quatd.h.

GF_API double Normalize ( double  eps = GF_MIN_VECTOR_LENGTH)

Normalizes this quaternion in place to unit length, returning the length before normalization.

If the length of this quaternion is smaller than eps, this sets the quaternion to identity.

bool operator!= ( const GfQuatd q) const
inline

Component-wise quaternion inequality test.

The real and imaginary parts must match exactly for quaternions to be considered equal.

Definition at line 171 of file quatd.h.

GF_API GfQuatd& operator*= ( const GfQuatd q)

Post-multiply quaternion q into this quaternion.

GfQuatd& operator*= ( double  s)
inline

Multiply this quaternion's coefficients by s.

Definition at line 180 of file quatd.h.

GfQuatd& operator+= ( const GfQuatd q)
inline

Add quaternion q to this quaternion.

Definition at line 194 of file quatd.h.

GfQuatd operator- ( ) const
inline

Component-wise negation.

Definition at line 158 of file quatd.h.

GfQuatd& operator-= ( const GfQuatd q)
inline

Component-wise unary difference operator.

Definition at line 201 of file quatd.h.

GfQuatd& operator/= ( double  s)
inline

Divide this quaternion's coefficients by s.

Definition at line 187 of file quatd.h.

bool operator== ( const GfQuatd q) const
inline

Component-wise quaternion equality test.

The real and imaginary parts must match exactly for quaternions to be considered equal.

Definition at line 164 of file quatd.h.

void SetImaginary ( const GfVec3d imaginary)
inline

Set the imaginary coefficients.

Definition at line 111 of file quatd.h.

void SetImaginary ( double  i,
double  j,
double  k 
)
inline

Set the imaginary coefficients.

Definition at line 116 of file quatd.h.

void SetReal ( double  real)
inline

Set the real coefficient.

Definition at line 105 of file quatd.h.

Friends And Related Function Documentation

size_t hash_value ( const GfQuatd q)
friend

Hash.

Definition at line 151 of file quatd.h.

GfQuatd operator* ( const GfQuatd q1,
const GfQuatd q2 
)
friend

Returns the product of quaternions q1 and q2.

Definition at line 221 of file quatd.h.

GfQuatd operator* ( const GfQuatd q,
double  s 
)
friend

Returns the product of quaternion q and scalar s.

Definition at line 227 of file quatd.h.

GfQuatd operator* ( double  s,
const GfQuatd q 
)
friend

Returns the product of quaternion q and scalar s.

Definition at line 233 of file quatd.h.

GfQuatd operator+ ( const GfQuatd q1,
const GfQuatd q2 
)
friend

Component-wise binary sum operator.

Definition at line 209 of file quatd.h.

GfQuatd operator- ( const GfQuatd q1,
const GfQuatd q2 
)
friend

Component-wise binary difference operator.

Definition at line 215 of file quatd.h.

GfQuatd operator/ ( const GfQuatd q,
double  s 
)
friend

Returns the product of quaternion q and scalar 1 / s.

Definition at line 239 of file quatd.h.


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