#include <points.H>
Inheritance diagram for mlib::NDCvec:
Public Types | |
typedef double | value_type |
Public Member Functions | |
Vec2 () | |
Vec2 (double x, double y) | |
NDCvec | operator+ (const NDCvec &v) const |
NDCvec | operator- (const NDCvec &v) const |
NDCvec | operator- () const |
double | operator * (const NDCvec &v) const |
NDCvec | operator * (double s) const |
NDCvec | operator/ (double s) const |
void | operator+= (const NDCvec &v) |
void | operator-= (const NDCvec &v) |
void | operator *= (double s) |
void | operator/= (double s) |
double | operator[] (int index) const |
double & | operator[] (int index) |
double | length () const |
double | length_sqrd () const |
bool | is_exact_null () const |
bool | is_null (double epsSqrdMath=epsNorSqrdMath()) const |
Tells if the vector is basically the zero vector. | |
NDCvec | normalized () const |
Returns a unit-length copy of this vector. | |
NDCvec | perpend () const |
Returns a copy of the vector rotated 90 degrees CCW. | |
double | dist (const NDCvec &v) const |
double | dist_sqrd (const NDCvec &v) const |
double | signed_angle (const NDCvec &) const |
Returns the signed angle between this vector and the given one. | |
double | angle (const NDCvec &v) const |
Returns the unsigned angle between the two vectors. The result will lie between 0 and pi radians. | |
double | tlen (const NDCvec &b) const |
Return (this * b) / (b * b). | |
NDCvec | projected (const NDCvec &b) const |
Returns the projection of this onto b. | |
NDCvec | orthogonalized (const NDCvec &b) const |
Returns this vector minus its projection onto b. | |
bool | is_equal (const NDCvec &v, double epsSqrd=epsNorSqrdMath()) const |
bool | is_parallel (const NDCvec &) const |
bool | operator== (const NDCvec &v) const |
bool | operator!= (const NDCvec &v) const |
Constructors | |
NDCvec () | |
NDCvec (double x, double y) | |
NDCvec (CXYvec &) | |
NDCvec (CVEXEL &) | |
NDCvec (CNDCZvec &v) | |
Vector Operations | |
NDCvec | perpendicular () const |
Static Public Member Functions | |
static CNDCvec & | null () |
static CNDCvec & | X () |
static CNDCvec & | Y () |
static int | dim () |
Protected Attributes | |
double | _x |
double | _y |
Static Protected Attributes | |
static CNDCvec | _null_vec |
static CNDCvec | _x_axis |
static CNDCvec | _y_axis |
Definition at line 945 of file points.H.
|
|
|
Definition at line 958 of file points.H. Referenced by perpendicular(). |
|
|
|
Definition at line 216 of file points.C. References mlib::Vec2< NDCvec >::_x, mlib::Vec2< NDCvec >::_y, and VIEW_ASPECT. |
|
Definition at line 233 of file points.C. References mlib::Vec2< NDCvec >::_x, mlib::Vec2< NDCvec >::_y, VIEW_ASPECT, and VIEW_SIZE. |
|
|
|
Returns the unsigned angle between the two vectors. The result will lie between 0 and pi radians.
|
|
|
|
|
|
|
|
|
|
|
|
Tells if the vector is basically the zero vector.
|
|
|
|
|
|
|
|
Returns a unit-length copy of this vector.
|
|
Definition at line 974 of file points.H. References _null_vec. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns this vector minus its projection onto b.
|
|
Returns a copy of the vector rotated 90 degrees CCW.
|
|
Definition at line 970 of file points.H. References mlib::Vec2< NDCvec >::_x, mlib::Vec2< NDCvec >::_y, and NDCvec(). |
|
Returns the projection of this onto b.
|
|
Returns the signed angle between this vector and the given one. I.e., returns the angle by which to rotate this vector counter-clockwise to align with the given vector. The result will be negative if the smallest rotation to get to the given vector is in the clockwise direction. The result will lie between -pi and pi radians: |
|
Return (this * b) / (b * b).
|
|
|
|
|
|
Definition at line 975 of file points.H. References _x_axis. |
|
Definition at line 976 of file points.H. References _y_axis. |
|
Definition at line 949 of file points.H. Referenced by null(). |
|
Definition at line 32 of file vec2.H. Referenced by NDCvec(), and perpendicular(). |
|
Definition at line 950 of file points.H. Referenced by X(). |
|
Definition at line 32 of file vec2.H. Referenced by NDCvec(), and perpendicular(). |
|
Definition at line 951 of file points.H. Referenced by Y(). |