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

COLVEC Class Reference

#include <color.H>

Inheritance diagram for COLVEC:

Inheritance graph
[legend]
Collaboration diagram for COLVEC:

Collaboration graph
[legend]
List of all members.

Public Types

typedef double value_type

Public Member Functions

 COLVEC ()
 COLVEC (double x, double y, double z)
 Vec3 ()
 Default constructor. Creates a zero length vector.
 Vec3 (double x, double y, double z)
 Constructor that sets the components of the vector to the values specified in the arguments.
const double * data () const
 Returns the elements of the vector as an array.
void set (double x, double y, double z)
 Sets the components of the vector to the values specified in the arguments.
double operator[] (int index) const
double & operator[] (int index)
COLVEC operator+ (const COLVEC &v) const
COLVEC operator- (const COLVEC &v) const
COLVEC operator- () const
double operator * (const COLVEC &v) const
COLVEC operator * (double s) const
COLVEC operator/ (double s) const
void operator+= (const COLVEC &v)
void operator-= (const COLVEC &v)
void operator *= (double s)
void operator/= (double s)
int operator> (const COLVEC &v) const
int operator< (const COLVEC &v) const
bool operator== (const COLVEC &v) const
bool operator!= (const COLVEC &v) const
double length () const
double length_sqrd () const
double length_rect () const
bool is_null (double epsSqrd=epsNorSqrdMath()) const
 Is the vector's length equal to zero?
double dist (const COLVEC &v) const
 Compute the distance between the two vectors.
double dist_sqrd (const COLVEC &v) const
 Compute the distance squared between the two vectors.
double angle (const COLVEC &) const
 Compute the angle between the two vectors. The result will be in the range 0 to pi radians.
double tlen (const COLVEC &b) const
 Returns (this * b) / (b * b).
COLVEC projected (const COLVEC &b) const
 Returns the projection of this onto b.
COLVEC orthogonalized (const COLVEC &b) const
 Returns this vector minus its projection onto b.
bool is_equal (const COLVEC &v, double epsSqrd=epsNorSqrdMath()) const
 Are the two vectors equal?
bool is_parallel (const COLVEC &) const
 Are the two vectors parallel?
bool is_perpend (const COLVEC &) const
 Are the two vectors perpendicular?
COLVEC normalized () const
 Return a unit-length copy of this vector.
COLVEC perpend () const
 Return a vector perpendicular to this one using an arbitrary axis algorithm.

Static Public Member Functions

static int dim ()

Protected Attributes

double _x
double _y
double _z

Detailed Description

Definition at line 14 of file color.H.


Member Typedef Documentation

typedef double mlib::Vec3< COLVEC >::value_type [inherited]
 

Definition at line 49 of file vec3.H.


Constructor & Destructor Documentation

COLVEC::COLVEC  )  [inline]
 

Definition at line 16 of file color.H.

COLVEC::COLVEC double  x,
double  y,
double  z
[inline]
 

Definition at line 17 of file color.H.


Member Function Documentation

double mlib::Vec3< COLVEC >::angle const COLVEC  )  const [inline, inherited]
 

Compute the angle between the two vectors. The result will be in the range 0 to pi radians.

const double* mlib::Vec3< COLVEC >::data  )  const [inline, inherited]
 

Returns the elements of the vector as an array.

Definition at line 58 of file vec3.H.

static int mlib::Vec3< COLVEC >::dim  )  [inline, static, inherited]
 

Definition at line 50 of file vec3.H.

double mlib::Vec3< COLVEC >::dist const COLVEC v  )  const [inline, inherited]
 

Compute the distance between the two vectors.

Definition at line 120 of file vec3.H.

double mlib::Vec3< COLVEC >::dist_sqrd const COLVEC v  )  const [inline, inherited]
 

Compute the distance squared between the two vectors.

Definition at line 122 of file vec3.H.

bool mlib::Vec3< COLVEC >::is_equal const COLVEC v,
double  epsSqrd = epsNorSqrdMath()
const [inline, inherited]
 

Are the two vectors equal?

Note:
Checks to see if the distance between the two vectors is less than or equal to epsSqrd.

Definition at line 148 of file vec3.H.

bool mlib::Vec3< COLVEC >::is_null double  epsSqrd = epsNorSqrdMath()  )  const [inline, inherited]
 

Is the vector's length equal to zero?

Definition at line 111 of file vec3.H.

bool mlib::Vec3< COLVEC >::is_parallel const COLVEC  )  const [inline, inherited]
 

Are the two vectors parallel?

bool mlib::Vec3< COLVEC >::is_perpend const COLVEC  )  const [inline, inherited]
 

Are the two vectors perpendicular?

double mlib::Vec3< COLVEC >::length  )  const [inline, inherited]
 

Definition at line 106 of file vec3.H.

double mlib::Vec3< COLVEC >::length_rect  )  const [inline, inherited]
 

Definition at line 108 of file vec3.H.

double mlib::Vec3< COLVEC >::length_sqrd  )  const [inline, inherited]
 

Definition at line 107 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::normalized  )  const [inline, inherited]
 

Return a unit-length copy of this vector.

COLVEC mlib::Vec3< COLVEC >::operator * double  s  )  const [inline, inherited]
 

Definition at line 76 of file vec3.H.

double mlib::Vec3< COLVEC >::operator * const COLVEC v  )  const [inline, inherited]
 

Definition at line 74 of file vec3.H.

void mlib::Vec3< COLVEC >::operator *= double  s  )  [inline, inherited]
 

Definition at line 81 of file vec3.H.

bool mlib::Vec3< COLVEC >::operator!= const COLVEC v  )  const [inline, inherited]
 

Definition at line 99 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::operator+ const COLVEC v  )  const [inline, inherited]
 

Definition at line 72 of file vec3.H.

void mlib::Vec3< COLVEC >::operator+= const COLVEC v  )  [inline, inherited]
 

Definition at line 79 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::operator-  )  const [inline, inherited]
 

Definition at line 75 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::operator- const COLVEC v  )  const [inline, inherited]
 

Definition at line 73 of file vec3.H.

void mlib::Vec3< COLVEC >::operator-= const COLVEC v  )  [inline, inherited]
 

Definition at line 80 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::operator/ double  s  )  const [inline, inherited]
 

Definition at line 77 of file vec3.H.

void mlib::Vec3< COLVEC >::operator/= double  s  )  [inline, inherited]
 

Definition at line 82 of file vec3.H.

int mlib::Vec3< COLVEC >::operator< const COLVEC v  )  const [inline, inherited]
 

Provided so that min(V, V) and max(V, V) work.

Note:
Comparison is done by length (not by comparing individual components).

Definition at line 96 of file vec3.H.

bool mlib::Vec3< COLVEC >::operator== const COLVEC v  )  const [inline, inherited]
 

Definition at line 98 of file vec3.H.

int mlib::Vec3< COLVEC >::operator> const COLVEC v  )  const [inline, inherited]
 

Provided so that min(V, V) and max(V, V) work.

Note:
Comparison is done by length (not by comparing individual components).

Definition at line 92 of file vec3.H.

double& mlib::Vec3< COLVEC >::operator[] int  index  )  [inline, inherited]
 

Definition at line 65 of file vec3.H.

double mlib::Vec3< COLVEC >::operator[] int  index  )  const [inline, inherited]
 

Definition at line 64 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::orthogonalized const COLVEC b  )  const [inline, inherited]
 

Returns this vector minus its projection onto b.

Definition at line 138 of file vec3.H.

COLVEC mlib::Vec3< COLVEC >::perpend  )  const [inline, inherited]
 

Return a vector perpendicular to this one using an arbitrary axis algorithm.

The arbitrary perpendicular vector is found as follows. First, the minimum length component of the vector is found. Second, a new vector is created that is the unit vector along the direction of the minimum component. Third, the perpendicular vector is found by taking the cross product of the vector with the minimum component set to zero and the original vector. Fourth, the perpendicular vector is normalized.

COLVEC mlib::Vec3< COLVEC >::projected const COLVEC b  )  const [inline, inherited]
 

Returns the projection of this onto b.

Definition at line 135 of file vec3.H.

void mlib::Vec3< COLVEC >::set double  x,
double  y,
double  z
[inline, inherited]
 

Sets the components of the vector to the values specified in the arguments.

Definition at line 62 of file vec3.H.

double mlib::Vec3< COLVEC >::tlen const COLVEC b  )  const [inline, inherited]
 

Returns (this * b) / (b * b).

Definition at line 129 of file vec3.H.

mlib::Vec3< COLVEC >::Vec3 double  x,
double  y,
double  z
[inline, inherited]
 

Constructor that sets the components of the vector to the values specified in the arguments.

Definition at line 42 of file vec3.H.

mlib::Vec3< COLVEC >::Vec3  )  [inline, inherited]
 

Default constructor. Creates a zero length vector.

Definition at line 39 of file vec3.H.


Member Data Documentation

double mlib::Vec3< COLVEC >::_x [protected, inherited]
 

Definition at line 31 of file vec3.H.

double mlib::Vec3< COLVEC >::_y [protected, inherited]
 

Definition at line 31 of file vec3.H.

double mlib::Vec3< COLVEC >::_z [protected, inherited]
 

Definition at line 31 of file vec3.H.


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:44:53 2006 for jot by  doxygen 1.4.4