SimpleCxxLib
packageclass GPoint
Constructor | |
GPoint(x, y) | Creates a GPoint object with the specified x and y coordinates. |
Methods | |
Returns the x component of the point. | |
Returns the y component of the point. | |
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() const;
Usage:
double x = pt.getX();
double getY() const;
Usage:
double y = pt.getY();
string toString() const;
GPoint
to a string in the form
"(
x,
y)"
.
Usage:
string str = pt.toString();