#include <color.H>
Inheritance diagram for COLVEC:
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 |
Definition at line 14 of file color.H.
|
|
|
|
|
|
|
Compute the angle between the two vectors. The result will be in the range 0 to pi radians.
|
|
Returns the elements of the vector as an array.
|
|
|
|
Compute the distance between the two vectors.
|
|
Compute the distance squared between the two vectors.
|
|
Are the two vectors equal?
|
|
Is the vector's length equal to zero?
|
|
Are the two vectors parallel?
|
|
Are the two vectors perpendicular?
|
|
|
|
|
|
|
|
Return a unit-length copy of this vector.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Provided so that min(V, V) and max(V, V) work.
|
|
|
|
Provided so that min(V, V) and max(V, V) work.
|
|
|
|
|
|
Returns this vector minus its projection onto b.
|
|
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. |
|
Returns the projection of this onto b.
|
|
Sets the components of the vector to the values specified in the arguments.
|
|
Returns (this * b) / (b * b).
|
|
Constructor that sets the components of the vector to the values specified in the arguments.
|
|
Default constructor. Creates a zero length vector.
|
|
|
|
|
|
|