4 /*****************************************************************************\
7 * Author : Chris Koeritz *
9 *******************************************************************************
10 * Copyright (c) 1992-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
21 class cartesian_point;
24 //! Represents a geometric ellipse.
25 /*! An ellipse is specified by its height, width and center. */
31 ellipse(const cartesian_point ¢er, double width_from_center,
32 double height_from_center);
33 ellipse(const ellipse &to_copy);
37 ellipse &operator = (const ellipse &to_copy);
40 //!< Returns the area occupied by the ellipse.
42 double perimeter() const;
43 //!< Returns the perimeter for the ellipse.
44 /*!< This is the length of the virtual string around the ellipse. The
45 returned value is an approximation. */
47 bool inside(const cartesian_point &where) const;
48 //!< Returns true if the point is inside the ellipse.
50 cartesian_point location(const double_angle &where) const;
51 //!< Describes the locus of the ellipse (basically, where it lives).
52 /*!< Returns the point on the ellipse that lies on a ray from the center
53 of the ellipse directed at an angle "where". */
55 cartesian_point center() const;
56 double width_from_center() const;
57 double height_from_center() const;
59 void center(const cartesian_point &to_set);
60 void width_from_center(double to_set);
61 void height_from_center(double to_set);
64 cartesian_point _center;
65 double _width_from_center;
66 double _height_from_center;