Xterminal Home Page Main page

class XPoint

Geometrical two-dimensional point

Public Fields

unsigned x
X coordinate of the point
unsigned y
Y coordinate of the point

Public Methods

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

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 __p)
Translates the point by the coordinates of the specified point
Returns:
translated point
Parameters:
__p - translation vector

XPoint& operator -= (XPoint __p)
Negatively translates the point by the coordinates of the specified point
Returns:
translated point
Parameters:
__p - 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

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

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

int operator < (XPoint __p)
Compares the coordinates of two points and returns true if the first one is nearer to the origin
Returns:
non zero if smaller
Parameters:
__p - right operand

int operator > (XPoint __p)
Compares the coordinates of two points and returns true if the second one is nearer to the origin
Returns:
non zero if greater
Parameters:
__p - right operand

int 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:
non zero if smaller or equal
Parameters:
__p - right operand

int 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:
non zero if greater or equal
Parameters:
__p - right operand


This class has no child classes.

Go to the hierarchy of classes.


Copyright ©1998 Dragos Acostachioaie, Bernd Kalbfuss
Last update on April 17, 1998

This page was generated with the help of doc++.