ellipse.h

Go to the documentation of this file.
00001 #ifndef ELLIPSE_CLASS
00002 #define ELLIPSE_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : ellipse                                                           *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1992-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 namespace geometric {
00019 
00020 // forward.
00021 class cartesian_point;
00022 class double_angle;
00023 
00025 
00027 class ellipse
00028 {
00029 public:
00030   ellipse();
00031   ellipse(const cartesian_point &center, double width_from_center,
00032           double height_from_center);
00033   ellipse(const ellipse &to_copy);
00034 
00035   ~ellipse();
00036 
00037   ellipse &operator = (const ellipse &to_copy);
00038 
00039   double area() const;
00041 
00042   double perimeter() const;
00044 
00047   bool inside(const cartesian_point &where) const;
00049 
00050   cartesian_point location(const double_angle &where) const;
00052 
00055   cartesian_point center() const;
00056   double width_from_center() const;
00057   double height_from_center() const;
00058 
00059   void center(const cartesian_point &to_set);
00060   void width_from_center(double to_set);
00061   void height_from_center(double to_set);
00062 
00063 protected:
00064   cartesian_point _center;
00065   double _width_from_center;
00066   double _height_from_center;
00067 };
00068 
00069 } // namespace.
00070 
00071 #endif
00072 
Generated on Sat Jan 28 04:22:41 2012 for hoople2 project by  doxygen 1.6.3