Geometrical two-dimensional point
Public Fields
-
unsigned x
- X coordinate of the point
-
unsigned y
- Y coordinate of the point
Public Methods
-
XPoint()
- Constructs a clean point with the coordinates (0, 0)
-
XPoint(unsigned __x, unsigned __y)
- Constructs a new point with the coordinates (__x, __y)
-
void Assign(unsigned __x, unsigned __y)
- Assigns the specified coordinates to the point
-
XPoint& operator += (XPoint __delta)
- Translates the point by the coordinates of the specified point
-
XPoint& operator -= (XPoint __delta)
- Negatively translates the point by the coordinates of the specified point
-
XPoint operator + (XPoint __p)
- Adds the coordinates of two points and returns the result as point
-
XPoint operator - (XPoint __p)
- Substracts the coordinates of two points and returns the result as point
-
XPoint& operator = (XPoint __p)
- Assigns the point the coordinates of the specified point
-
bool operator == (XPoint __p)
- Compares the coordinates of two points and returns true if they are equal
-
bool operator != (XPoint __p)
- Compares the coordinates of two points and returns false if they are equal
-
bool operator < (XPoint __p)
- Compares the coordinates of two points and returns true if the first one is nearer to the origin
-
bool operator > (XPoint __p)
- Compares the coordinates of two points and returns true if the second one is nearer to the origin
-
bool operator <= (XPoint __p)
- Compares the coordinates of two points and returns true if the first one is nearer or as far as the second one from the origin
-
bool operator >= (XPoint __p)
- Compares the coordinates of two points and returns true if the second one is nearer or as far as the first one from the origin
Documentation
The XPoint class is the two dimensional representation of a
geometrical point with the coordinates x and y. Methods to assign
coordinates and operators for mathematical calculation are included.
unsigned x
- X coordinate of the point
unsigned y
- Y coordinate of the point
XPoint()
- Constructs a clean point with the coordinates (0, 0)
XPoint(unsigned __x, unsigned __y)
- Constructs a new point with the coordinates (__x, __y)
- Parameters:
- __x - x coordinate
__y - y coordinate
void Assign(unsigned __x, unsigned __y)
- Assigns the specified coordinates to the point
- Parameters:
- __x - x coordinate
__y - y coordinate
XPoint& operator += (XPoint __delta)
- Translates the point by the coordinates of the specified point
- Returns:
- translated point
- Parameters:
- __delta - translation vector
XPoint& operator -= (XPoint __delta)
- Negatively translates the point by the coordinates of the specified
point
- Returns:
- translated point
- Parameters:
- __delta - translation vector
XPoint operator + (XPoint __p)
- Adds the coordinates of two points and returns the result as point
- Returns:
- sum of points
- Parameters:
- __p - right operand
XPoint operator - (XPoint __p)
- Substracts the coordinates of two points and returns the result as
point
- Returns:
- difference of points
- Parameters:
- __p - right operand
XPoint& operator = (XPoint __p)
- Assigns the point the coordinates of the specified point
- Returns:
- assigned point
- Parameters:
- __p - value to assign
bool operator == (XPoint __p)
- Compares the coordinates of two points and returns true if they are
equal
- Returns:
- true if equal
- Parameters:
- __p - right operand
bool operator != (XPoint __p)
- Compares the coordinates of two points and returns false if they are
equal
- Returns:
- false if equal
- Parameters:
- __p - right operand
bool operator < (XPoint __p)
- Compares the coordinates of two points and returns true if the first
one is nearer to the origin
- Returns:
- true if smaller
- Parameters:
- __p - right operand
bool operator > (XPoint __p)
- Compares the coordinates of two points and returns true if the second
one is nearer to the origin
- Returns:
- true if greater
- Parameters:
- __p - right operand
bool operator <= (XPoint __p)
- Compares the coordinates of two points and returns true if the first
one is nearer or as far as the second one from the origin
- Returns:
- true if smaller or equal
- Parameters:
- __p - right operand
bool operator >= (XPoint __p)
- Compares the coordinates of two points and returns true if the second
one is nearer or as far as the first one from the origin
- Returns:
- true if greater or equal
- Parameters:
- __p - right operand
- This class has no child classes.
Go to the hierarchy of classes.
Copyright ©1998 Bernd Kalbfuss
Last update on October 27, 2001
This page was generated with the help of DOC++.