include/vamos/geometry/Two_Point.h

Go to the documentation of this file.
00001 //      Vamos - a driving simulator
00002 //  Copyright (C) 2001 Sam Varner
00003 //
00004 //  This program is free software; you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation; either version 2 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program; if not, write to the Free Software
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 #ifndef _TWO_POINT_H_
00019 #define _TWO_POINT_H_
00020 
00021 #include <iostream>
00022 
00023 namespace Vamos_Geometry
00024 {
00025   class Two_Point
00026   {
00027           public:
00028                   
00029         double x;
00030         double y;
00031         
00032         Two_Point (double x_in, double y_in) : x (x_in), y (y_in) {};
00033         Two_Point () : x (0.0), y (0.0) {};
00034   };
00035 
00036   // Arithmetic operators
00037   Two_Point operator + (Two_Point p1, Two_Point p2);
00038   Two_Point operator + (Two_Point p, double scalar);
00039   Two_Point operator + (double scalar, Two_Point p);
00040   Two_Point operator - (Two_Point p1, Two_Point p2);
00041   Two_Point operator - (Two_Point p, double scalar);
00042   Two_Point operator - (double scalar, Two_Point p);
00043   Two_Point operator * (Two_Point p1, Two_Point p2);
00044   Two_Point operator * (Two_Point p, double scalar);
00045   Two_Point operator * (double scalar, Two_Point p);
00046   Two_Point operator / (Two_Point p1, Two_Point p2);
00047   Two_Point operator / (Two_Point p, double scalar);
00048   Two_Point operator / (double scalar, Two_Point p);
00049 
00050   // Stream operators.
00051   std::istream& operator >> (std::istream& is, Two_Point& point);
00052   std::ostream& operator << (std::ostream& os, const Two_Point& point);
00053 }
00054 
00055 #endif

Generated on Thu Oct 19 04:05:48 2006 by  doxygen 1.4.6