Return to Index

Point

A storage unit for integral x and y coordinates. The x and y coordinates can be accessed directly. For example:
   Point pt;
   pt.x = 1;
   pt.y = 2;


Method Summary:
Point::Point();
Point::Point(int x, int y);
void Point::set(int x, int y);
double Point::distance(const Point& p1, const Point& p2);



Point::Point
Point::Point();

Constructs a new point.

Point::Point
Point::Point(int x, int y);

Constructs a new point with the specified x and y values.
Parameters:
int xThe X-value.
int yThe Y-value.

void Point::set
void Point::set(int x, int y);

Sets the x and y values.
Parameters:
int xThe X-value.
int yThe Y-value.

double Point::distance
double Point::distance(const Point& p1, const Point& p2);

Calculates the distance between the two points. Note that this is a static function.
Parameters:
const Point& p1The first point.
const Point& p2The second point.


Generated automatically by docgen 0.0.1
© 2003 Aron Dobos