#include <points.H>
Inheritance diagram for mlib::NDCZvec:
Public Types | |
typedef double | value_type |
Public Member Functions | |
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) |
NDCZvec | operator+ (const NDCZvec &v) const |
NDCZvec | operator- (const NDCZvec &v) const |
NDCZvec | operator- () const |
double | operator * (const NDCZvec &v) const |
NDCZvec | operator * (double s) const |
NDCZvec | operator/ (double s) const |
void | operator+= (const NDCZvec &v) |
void | operator-= (const NDCZvec &v) |
void | operator *= (double s) |
void | operator/= (double s) |
int | operator> (const NDCZvec &v) const |
int | operator< (const NDCZvec &v) const |
bool | operator== (const NDCZvec &v) const |
bool | operator!= (const NDCZvec &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 NDCZvec &v) const |
Compute the distance between the two vectors. | |
double | dist_sqrd (const NDCZvec &v) const |
Compute the distance squared between the two vectors. | |
double | angle (const NDCZvec &) const |
Compute the angle between the two vectors. The result will be in the range 0 to pi radians. | |
double | tlen (const NDCZvec &b) const |
Returns (this * b) / (b * b). | |
NDCZvec | projected (const NDCZvec &b) const |
Returns the projection of this onto b. | |
NDCZvec | orthogonalized (const NDCZvec &b) const |
Returns this vector minus its projection onto b. | |
bool | is_equal (const NDCZvec &v, double epsSqrd=epsNorSqrdMath()) const |
Are the two vectors equal? | |
bool | is_parallel (const NDCZvec &) const |
Are the two vectors parallel? | |
bool | is_perpend (const NDCZvec &) const |
Are the two vectors perpendicular? | |
NDCZvec | normalized () const |
Return a unit-length copy of this vector. | |
NDCZvec | perpend () const |
Return a vector perpendicular to this one using an arbitrary axis algorithm. | |
Constructors | |
NDCZvec () | |
NDCZvec (double x, double y, double z) | |
NDCZvec (CNDCvec &) | |
NDCZvec (CXYvec &) | |
NDCZvec (CWvec &v, CWtransf &obj_to_ndc_der) | |
NDCZvec (CVEXEL &) | |
Vector Operations | |
NDCZvec | perpendicular () const |
Computes an arbitrary vector that is perpendicular to this one and that lies in the xy-plane. | |
Vector Property Queries | |
double | planar_length () const |
Computes the length of the vector in the xy-plane (i.e. ignores depth). | |
Static Public Member Functions | |
static CNDCZvec & | null () |
static CNDCZvec & | X () |
static CNDCZvec & | Y () |
static CNDCZvec & | Z () |
static int | dim () |
Protected Attributes | |
double | _x |
double | _y |
double | _z |
Static Protected Attributes | |
static CNDCZvec | _null_vec |
static CNDCZvec | _x_axis |
static CNDCZvec | _y_axis |
static CNDCZvec | _z_axis |
Definition at line 675 of file points.H.
|
|
|
Definition at line 689 of file points.H. Referenced by perpendicular(). |
|
|
|
Definition at line 310 of file points.C. References mlib::Vec3< NDCZvec >::_x, mlib::Vec3< NDCZvec >::_y, and mlib::Vec3< NDCZvec >::_z. |
|
Definition at line 317 of file points.C. References mlib::Vec3< NDCZvec >::_x, mlib::Vec3< NDCZvec >::_y, mlib::Vec3< NDCZvec >::_z, and VIEW_ASPECT. |
|
Definition at line 345 of file points.C. References mlib::Vec3< NDCZvec >::_x, mlib::Vec3< NDCZvec >::_y, and mlib::Vec3< NDCZvec >::_z. |
|
Definition at line 330 of file points.C. References mlib::Vec3< NDCZvec >::_x, mlib::Vec3< NDCZvec >::_y, mlib::Vec3< NDCZvec >::_z, VIEW_ASPECT, and VIEW_SIZE. |
|
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.
|
|
Definition at line 719 of file points.H. References _null_vec. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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. |
|
Computes an arbitrary vector that is perpendicular to this one and that lies in the xy-plane. Differs from the perpend() function becayse it only takes the x and y coordinates into account (i.e. it ignores depth). Definition at line 706 of file points.H. References mlib::Vec3< NDCZvec >::_x, mlib::Vec3< NDCZvec >::_y, and NDCZvec(). |
|
Computes the length of the vector in the xy-plane (i.e. ignores depth).
Definition at line 715 of file points.H. References mlib::Vec3< NDCZvec >::_x, and mlib::Vec3< NDCZvec >::_y. |
|
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.
|
|
Definition at line 720 of file points.H. References _x_axis. |
|
Definition at line 721 of file points.H. References _y_axis. |
|
Definition at line 722 of file points.H. References _z_axis. |
|
Definition at line 679 of file points.H. Referenced by null(). |
|
Definition at line 31 of file vec3.H. Referenced by NDCZvec(), perpendicular(), and planar_length(). |
|
Definition at line 680 of file points.H. Referenced by X(). |
|
Definition at line 31 of file vec3.H. Referenced by NDCZvec(), perpendicular(), and planar_length(). |
|
Definition at line 681 of file points.H. Referenced by Y(). |
|
Definition at line 31 of file vec3.H. Referenced by NDCZvec(). |
|
Definition at line 682 of file points.H. Referenced by Z(). |