#include <points.H>
Inheritance diagram for mlib::XYvec:
Public Types | |
typedef double | value_type |
Public Member Functions | |
Vec2 () | |
Vec2 (double x, double y) | |
XYvec | operator+ (const XYvec &v) const |
XYvec | operator- (const XYvec &v) const |
XYvec | operator- () const |
double | operator * (const XYvec &v) const |
XYvec | operator * (double s) const |
XYvec | operator/ (double s) const |
void | operator+= (const XYvec &v) |
void | operator-= (const XYvec &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. | |
XYvec | normalized () const |
Returns a unit-length copy of this vector. | |
XYvec | perpend () const |
Returns a copy of the vector rotated 90 degrees CCW. | |
double | dist (const XYvec &v) const |
double | dist_sqrd (const XYvec &v) const |
double | signed_angle (const XYvec &) const |
Returns the signed angle between this vector and the given one. | |
double | angle (const XYvec &v) const |
Returns the unsigned angle between the two vectors. The result will lie between 0 and pi radians. | |
double | tlen (const XYvec &b) const |
Return (this * b) / (b * b). | |
XYvec | projected (const XYvec &b) const |
Returns the projection of this onto b. | |
XYvec | orthogonalized (const XYvec &b) const |
Returns this vector minus its projection onto b. | |
bool | is_equal (const XYvec &v, double epsSqrd=epsNorSqrdMath()) const |
bool | is_parallel (const XYvec &) const |
bool | operator== (const XYvec &v) const |
bool | operator!= (const XYvec &v) const |
Constructors | |
XYvec () | |
XYvec (double x, double y) | |
XYvec (CNDCvec &) | |
XYvec (CVEXEL &) | |
Static Public Member Functions | |
static CXYvec & | null () |
static CXYvec & | X () |
static CXYvec & | Y () |
static int | dim () |
Protected Attributes | |
double | _x |
double | _y |
Static Protected Attributes | |
static CXYvec | _null_vec |
static CXYvec | _x_axis |
static CXYvec | _y_axis |
Definition at line 534 of file points.H.
|
|
|
|
|
|
|
Definition at line 136 of file points.C. References mlib::Vec2< XYvec >::_x, mlib::Vec2< XYvec >::_y, and VIEW_ASPECT. |
|
Definition at line 166 of file points.C. References mlib::Vec2< XYvec >::_x, mlib::Vec2< XYvec >::_y, 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 554 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.
|
|
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 555 of file points.H. References _x_axis. |
|
Definition at line 556 of file points.H. References _y_axis. |
|
Definition at line 538 of file points.H. Referenced by null(). |
|
Definition at line 32 of file vec2.H. Referenced by XYvec(). |
|
Definition at line 539 of file points.H. Referenced by X(). |
|
Definition at line 32 of file vec2.H. Referenced by XYvec(). |
|
Definition at line 540 of file points.H. Referenced by Y(). |