/************************************************************************ * * * File: point2.h * * * * Author: Robb T. Koether * * * * Date: Sep 9, 2003 * * * * Purpose: This file contains the definition of the Point2 class * * * ************************************************************************/ #ifndef POINT2_H #define POINT2_H // Header files #include #include using namespace std; /************************************************************************ * * * The definition of the Point2 class * * * ************************************************************************/ class Point2 { // Public member functions public: // Inspectors Point2() : x(0), y(0) {} Point2(float xval, float yval) : x(xval), y(yval) {} // Mutators void set(float xval, float yval) {x = xval; y = yval;} void Output(ostream& out) const { out << "(" << x << ", " << y << ")"; } // Other functions bool equal(const Point2& p) const; // Public data members public: float x; float y; }; // Operators ostream& operator<<(ostream& out, const Point2& p); bool operator==(const Point2& p, const Point2& q); #endif