class XPoint

Geometrical two-dimensional point

Public Fields

[more]unsigned x
X coordinate of the point
[more]unsigned y
Y coordinate of the point

Public Methods

[more] XPoint()
Constructs a clean point with the coordinates (0, 0)
[more] XPoint(unsigned __x, unsigned __y)
Constructs a new point with the coordinates (__x, __y)
[more]void Assign(unsigned __x, unsigned __y)
Assigns the specified coordinates to the point
[more]XPoint& operator += (XPoint __delta)
Translates the point by the coordinates of the specified point
[more]XPoint& operator -= (XPoint __delta)
Negatively translates the point by the coordinates of the specified point
[more]XPoint operator + (XPoint __p)
Adds the coordinates of two points and returns the result as point
[more]XPoint operator - (XPoint __p)
Substracts the coordinates of two points and returns the result as point
[more]XPoint& operator = (XPoint __p)
Assigns the point the coordinates of the specified point
[more]bool operator == (XPoint __p)
Compares the coordinates of two points and returns true if they are equal
[more]bool operator != (XPoint __p)
Compares the coordinates of two points and returns false if they are equal
[more]bool operator < (XPoint __p)
Compares the coordinates of two points and returns true if the first one is nearer to the origin
[more]bool operator > (XPoint __p)
Compares the coordinates of two points and returns true if the second one is nearer to the origin
[more]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
[more]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.
ounsigned x
X coordinate of the point

ounsigned y
Y coordinate of the point

o XPoint()
Constructs a clean point with the coordinates (0, 0)

o XPoint(unsigned __x, unsigned __y)
Constructs a new point with the coordinates (__x, __y)
Parameters:
__x - x coordinate
__y - y coordinate

ovoid Assign(unsigned __x, unsigned __y)
Assigns the specified coordinates to the point
Parameters:
__x - x coordinate
__y - y coordinate

oXPoint& operator += (XPoint __delta)
Translates the point by the coordinates of the specified point
Returns:
translated point
Parameters:
__delta - translation vector

oXPoint& operator -= (XPoint __delta)
Negatively translates the point by the coordinates of the specified point
Returns:
translated point
Parameters:
__delta - translation vector

oXPoint operator + (XPoint __p)
Adds the coordinates of two points and returns the result as point
Returns:
sum of points
Parameters:
__p - right operand

oXPoint operator - (XPoint __p)
Substracts the coordinates of two points and returns the result as point
Returns:
difference of points
Parameters:
__p - right operand

oXPoint& operator = (XPoint __p)
Assigns the point the coordinates of the specified point
Returns:
assigned point
Parameters:
__p - value to assign

obool operator == (XPoint __p)
Compares the coordinates of two points and returns true if they are equal
Returns:
true if equal
Parameters:
__p - right operand

obool operator != (XPoint __p)
Compares the coordinates of two points and returns false if they are equal
Returns:
false if equal
Parameters:
__p - right operand

obool 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

obool 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

obool 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

obool 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++.