Public Attributes

decDVector Class Reference

3 Component Double precision Vector. More...

#include <decDVector.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decDVector ()
 Creates a new vector initialized to ( 0,0,0 ).
 decDVector (double nx, double ny, double nz)
 Creates a new vector with the given values.
 decDVector (const decDVector &v)
 Creatses a new vector with the values of another vector.
 decDVector (const decVector &v)
 Creatses a new vector with the values of another vector.
Management
double Length () const
 Retrieves the length of the vector.
void Normalize ()
 Normalizes the vector.
void Snap (double grid)
 Snaps the components of the vector to a grid with the given size.
bool IsEqualTo (const decDVector &v, double threshold=1e-6) const
 Determines if the components of this vector are equal to another one with respect to a threshold.
void SetZero ()
 Sets all components to 0.
void Set (double nx, double ny, double nz)
 Sets the components to the given values.
void Set (const decDVector &v)
 Sets the components to the given vector.
void Set (const decVector &v)
 Sets the components to the given vector.
void Negate ()
 Negates the vector.
decVector ToVector () const
 Concerts to a normal precision vector with possible precision loss.
Operators
decDVector operator- () const
 Retrieves the negation of this vector.
decDVectoroperator= (const decDVector &v)
 Sets the components of this vector to the values of another one.
decDVectoroperator+= (const decDVector &v)
 Adds the components of another vector to this one.
decDVectoroperator-= (const decDVector &v)
 Subtracts the components of another vector from this vector.
decDVectoroperator*= (double k)
 Multiplies the components of this vector with a value k.
decDVectoroperator/= (double k)
 Divides the components of this vector by a value k.
decDVector operator+ (const decDVector &v) const
 Retrieves a new vector with the sum of this vector with another one.
decDVector operator- (const decDVector &v) const
 Retrieves a new vector with the difference of this vector to another one.
decDVector operator* (double k) const
 Retrieves a new vector with this vector scaled by k.
double operator* (const decDVector &v) const
 Calculates the dor product of this vector with another one.
decDVector operator/ (double k) const
 Retrieves a new vector with this vector divided by k.
decDVector operator% (const decDVector &v) const
 Retrieves a new vector with the cross producr of this vector with another one.
bool operator< (const decDVector &v) const
 Determines if all the components of this vector are less then the components of another one.
bool operator> (const decDVector &v) const
 Determines if all the components of this vector are greater then the components of another one.
bool operator<= (const decDVector &v) const
 Determines if all the components of this vector are less then or equal to the components of another one.
bool operator>= (const decDVector &v) const
 Determines if all the components of this vector are greater then or equal to the components of another one.

Public Attributes

double x
 X Component of vector.
double y
 Y Component of vector.
double z
 Z Component of vector.

Detailed Description

3 Component Double precision Vector.

The difference to the other vector class is just that this class uses double instead of float.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

decDVector::decDVector (  ) [inline]

Creates a new vector initialized to ( 0,0,0 ).

References x, y, and z.

Referenced by operator%(), operator*(), operator+(), operator-(), and operator/().

decDVector::decDVector ( double  nx,
double  ny,
double  nz 
) [inline]

Creates a new vector with the given values.

References x, y, and z.

decDVector::decDVector ( const decDVector v ) [inline]

Creatses a new vector with the values of another vector.

References x, y, and z.

decDVector::decDVector ( const decVector v ) [inline]

Creatses a new vector with the values of another vector.

References decVector::x, x, decVector::y, y, decVector::z, and z.


Member Function Documentation

bool decDVector::IsEqualTo ( const decDVector v,
double  threshold = 1e-6 
) const

Determines if the components of this vector are equal to another one with respect to a threshold.

double decDVector::Length (  ) const

Retrieves the length of the vector.

void decDVector::Negate (  ) [inline]

Negates the vector.

References x, y, and z.

void decDVector::Normalize (  )

Normalizes the vector.

If the length of the vector is 0 an exception is thrown.

decDVector decDVector::operator% ( const decDVector v ) const [inline]

Retrieves a new vector with the cross producr of this vector with another one.

References decDVector(), x, y, and z.

decDVector decDVector::operator* ( double  k ) const [inline]

Retrieves a new vector with this vector scaled by k.

References decDVector(), x, y, and z.

double decDVector::operator* ( const decDVector v ) const [inline]

Calculates the dor product of this vector with another one.

References x, y, and z.

decDVector& decDVector::operator*= ( double  k ) [inline]

Multiplies the components of this vector with a value k.

References x, y, and z.

decDVector decDVector::operator+ ( const decDVector v ) const [inline]

Retrieves a new vector with the sum of this vector with another one.

References decDVector(), x, y, and z.

decDVector& decDVector::operator+= ( const decDVector v ) [inline]

Adds the components of another vector to this one.

References x, y, and z.

decDVector decDVector::operator- ( const decDVector v ) const [inline]

Retrieves a new vector with the difference of this vector to another one.

References decDVector(), x, y, and z.

decDVector decDVector::operator- (  ) const [inline]

Retrieves the negation of this vector.

References decDVector(), x, y, and z.

decDVector& decDVector::operator-= ( const decDVector v ) [inline]

Subtracts the components of another vector from this vector.

References x, y, and z.

decDVector decDVector::operator/ ( double  k ) const [inline]

Retrieves a new vector with this vector divided by k.

If k is 0 an exception is thrown.

References decDVector(), THROW, x, y, and z.

decDVector& decDVector::operator/= ( double  k ) [inline]

Divides the components of this vector by a value k.

If the value k is 0 an exception is thrown.

References THROW, x, y, and z.

bool decDVector::operator< ( const decDVector v ) const [inline]

Determines if all the components of this vector are less then the components of another one.

References x, y, and z.

bool decDVector::operator<= ( const decDVector v ) const [inline]

Determines if all the components of this vector are less then or equal to the components of another one.

References x, y, and z.

decDVector& decDVector::operator= ( const decDVector v ) [inline]

Sets the components of this vector to the values of another one.

References x, y, and z.

bool decDVector::operator> ( const decDVector v ) const [inline]

Determines if all the components of this vector are greater then the components of another one.

References x, y, and z.

bool decDVector::operator>= ( const decDVector v ) const [inline]

Determines if all the components of this vector are greater then or equal to the components of another one.

References x, y, and z.

void decDVector::Set ( const decDVector v ) [inline]

Sets the components to the given vector.

References x, y, and z.

void decDVector::Set ( double  nx,
double  ny,
double  nz 
) [inline]

Sets the components to the given values.

References x, y, and z.

void decDVector::Set ( const decVector v ) [inline]

Sets the components to the given vector.

References decVector::x, x, decVector::y, y, decVector::z, and z.

void decDVector::SetZero (  ) [inline]

Sets all components to 0.

References x, y, and z.

void decDVector::Snap ( double  grid )

Snaps the components of the vector to a grid with the given size.

decVector decDVector::ToVector (  ) const

Concerts to a normal precision vector with possible precision loss.


Member Data Documentation

double decDVector::x
double decDVector::y
double decDVector::z

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