#include <xrect.h>
Public Member Functions | |
| XPoint (const int initX=0, const int initY=0) | |
| XPoint (const XPoint &initPt) | |
| XPoint | operator+ (const XPoint &p) const |
| Add the X and Y coordinates of the points. | |
| XPoint | operator- (const XPoint &p) const |
| Subtract the X and Y coordinates of the points. | |
| XPoint & | operator/= (const double v) |
| XPoint & | operator *= (const double v) |
| XPoint & | operator/= (const int v) |
| XPoint & | operator *= (const int v) |
| XPoint & | operator+= (const int v) |
| XPoint & | operator-= (const int v) |
| XPoint & | operator= (const XPoint &p) |
| Assign the value of point p to the point. | |
| const bool | operator== (const XPoint &p) const |
| Equality operator evaluates to true if the x and y coordinates are the same for both points. | |
| const bool | leftof (const XPoint &p) const |
| true if the point is to the left of point p | |
| const bool | rightof (const XPoint &p) const |
| true if the point is to the right of point p | |
| const bool | above (const XPoint &p) const |
| true if the point is above point p | |
| const bool | below (const XPoint &p) const |
| true if the point is below point p | |
| const double | dist (void) |
Data Fields | |
| int | x |
| int | y |
|
||||||||||||
|
Definition at line 14 of file xrect.h. Referenced by operator+(), and operator-().
|
|
|
Definition at line 17 of file xrect.h.
|
|
|
true if the point is above point p
Definition at line 45 of file xrect.h. References y.
00045 { return (y < p.y); }
|
|
|
true if the point is below point p
Definition at line 48 of file xrect.h. References y.
00048 { return (y > p.y); }
|
|
|
Definition at line 50 of file xrect.h.
00051 { return sqrt( (double)x * x + (double)y * y ); }
|
|
|
true if the point is to the left of point p
Definition at line 39 of file xrect.h. References x.
00039 { return (x < p.x); }
|
|
|
Definition at line 28 of file xrect.h.
|
|
|
Definition at line 26 of file xrect.h.
|
|
|
Add the X and Y coordinates of the points.
Definition at line 21 of file xrect.h. References x, XPoint(), and y.
00021 { return XPoint( x + p.x , y + p.y ); }
|
|
|
Definition at line 29 of file xrect.h.
|
|
|
Subtract the X and Y coordinates of the points.
Definition at line 23 of file xrect.h. References x, XPoint(), and y.
00023 { return XPoint( x - p.x , y - p.y ); }
|
|
|
Definition at line 30 of file xrect.h.
|
|
|
Definition at line 27 of file xrect.h.
|
|
|
Definition at line 25 of file xrect.h.
|
|
|
Assign the value of point p to the point.
Definition at line 33 of file xrect.h.
|
|
|
Equality operator evaluates to true if the x and y coordinates are the same for both points.
Definition at line 36 of file xrect.h.
|
|
|
true if the point is to the right of point p
Definition at line 42 of file xrect.h. References x.
00042 { return (x > p.x); }
|
|
|
1.3.3