struct GPointx and y, used to specify the
x,y coordinates of a point in the graphics plane.
| Fields | |
Type double | |
Type double | |
| Constructor | |
GPoint(x, y) | Initializes a GPoint with the specified x and y coordinates. |
| Methods | |
Returns a string representation of this GPoint 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 both fields to 0. The GPoint fields x and y also can be directly accessed using dot notation.
Usage:
GPoint origin; // x,y = 0,0 GPoint pt(x, y); pt.x += 10; if (origin.y == pt.y) ...
string toString() const;
GPoint in the form
"(x, y)".
Usage:
string str = pt.toString();