class GPoint| Constructor | |
| GPoint() GPoint(x, y) | Creates a GPoint object with the specified x and y coordinates. |
| Methods | |
| getX() | Returns the x component of the point. |
| getY() | Returns the y component of the point. |
| toString() | Converts the GPoint to a string in the form "(x, y)". |
GPoint(); GPoint(double x, double y);
GPoint object with the specified x
and y coordinates. If the coordinates are not supplied,
the default constructor sets these fields to 0.
Usage:
GPoint origin; GPoint pt(x, y);
double getX();
Usage:
double x = pt.getX();
double getY();
Usage:
double y = pt.getY();
string toString();
GPoint to a string in the form
"(x, y)".
Usage:
string str = pt.toString();