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 \*****************************************************************************/
18 #include "cartesian_objects.h"
22 //! Represents a geometric circle.
24 A circle is specified by its center and its radius. The angles are
32 circle(double radius, const cartesian_point ¢er);
36 //!< Returns the area occupied by the circle.
38 double circumference() const;
39 //!< Returns the perimeter for the circle.
40 /*!< The circumference is the length of a virtual string around the
43 double diameter() const;
44 //!< Returns the length of the circle's bisecting line.
45 /*!< This is the length of a line segment that is circumscribed by the
46 circle and which passes through the center of the circle. */
48 bool inside(const cartesian_point &where) const;
49 //!< Returns true if the point is inside the circle.
51 cartesian_point location(const double_angle &where) const;
52 //!< Returns the point on the circle that is at the angle "where".
54 cartesian_rectangle dimensions() const;
55 //!< Returns a bounding box around the circle.
57 double radius() const; //!< Half of the circle's diameter.
58 void radius(double to_set); //!< Sets the radius of the circle.
60 cartesian_point center() const; //!< The point at the center of the circle.
61 void center(const cartesian_point &to_set); //!< Resets the circle's center.
64 double _radius; //!< Records the current radius.
65 cartesian_point _center; //!< Records the current center.