#include "gtypes.h"

class GPoint

This class represents a point on the real-valued graphics plane.
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)".

Constructor detail


GPoint();
GPoint(double x, double y);
Creates a 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);

Method detail


double getX();
Returns the x component of the point.

Usage:

double x = pt.getX();

double getY();
Returns the y component of the point.

Usage:

double y = pt.getY();

string toString();
Converts the GPoint to a string in the form "(x, y)".

Usage:

string str = pt.toString();