home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / freedraft.tar.gz / freedraft.tar / FREEdraft-050298 / GEOMLIB2D / arc.h < prev    next >
C/C++ Source or Header  |  1998-04-29  |  2KB  |  65 lines

  1. // arc.h
  2.  
  3. // Copyright (C) 1997  Cliff Johnson                                       //
  4. //                                                                         //
  5. // This program is free software; you can redistribute it and/or           //
  6. // modify it under the terms of the GNU  General Public                    //
  7. // License as published by the Free Software Foundation; either            //
  8. // version 2 of the License, or (at your option) any later version.        //
  9. //                                                                         //
  10. // This software is distributed in the hope that it will be useful,        //
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of          //
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       //
  13. // General Public License for more details.                                //
  14. //                                                                         //
  15. // You should have received a copy of the GNU General Public License       //
  16. // along with this software (see COPYING); if not, write to the        //
  17. // Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
  18.  
  19. #ifndef ARC_H
  20. #define ARC_H
  21.  
  22. #include "geom.h"    // ISA
  23. #include "point.h"    // HASA
  24. #include <iostream.h>    // ITO
  25.  
  26. class Circle;
  27. class GeomException;
  28.  
  29. class Arc: public Geom
  30. {
  31.  
  32. private:
  33.     Point center;
  34.     Point origin;
  35.     Point endpoint;
  36.     double arcAngle;        // subtended angle
  37.  
  38. public:
  39.  
  40. // constructors
  41.     Arc();
  42.     Arc(const Point& c, const Point& o, const Point& e) throw (GeomException);    // center and arc origin
  43.  
  44.     virtual ~Arc() {}
  45.  
  46. // evaluation functions
  47.     Point Center() const { return center; }
  48.     Point Origin() const { return origin; }
  49.     Point Endpoint() const { return endpoint; }
  50.     Point U(double u) const;
  51.     double Radius() const;
  52.     double ArcAngle() const { return arcAngle; }
  53.     Circle Support() const; 
  54.     
  55.     friend ostream& operator<<(ostream& os, const Arc& c);
  56.  
  57.     virtual double Distance(const Point&) const;
  58.  
  59.     Point Project(const Point&) const throw (GeomException);
  60.     double UProject(const Point&) const throw (GeomException);
  61. };
  62.  
  63.  
  64. #endif
  65.