feisty meow concerns codebase 2.140
circle.h
Go to the documentation of this file.
1#ifndef CIRCLE_CLASS
2#define CIRCLE_CLASS
3
4/*****************************************************************************\
5* *
6* Name : circle *
7* Author : Chris Koeritz *
8* *
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\*****************************************************************************/
17
18#include "cartesian_objects.h"
19
20namespace geometric {
21
23
28class circle
29{
30public:
31 circle();
32 circle(double radius, const cartesian_point &center);
33 ~circle();
34
35 double area() const;
37
38 double circumference() const;
40
43 double diameter() const;
45
48 bool inside(const cartesian_point &where) const;
50
51 cartesian_point location(const double_angle &where) const;
53
56
57 double radius() const;
58 void radius(double to_set);
59
60 cartesian_point center() const;
61 void center(const cartesian_point &to_set);
62
63private:
64 double _radius;
65 cartesian_point _center;
66};
67
68} // namespace.
69
70#endif
71
Provides a geometric point that use double floating points numbers.
Provides a geometric rectangle that use double floating points numbers.
Represents a geometric circle.
Definition circle.h:29
double circumference() const
Returns the perimeter for the circle.
Definition circle.cpp:39
cartesian_rectangle dimensions() const
Returns a bounding box around the circle.
Definition circle.cpp:54
double radius() const
Half of the circle's diameter.
Definition circle.cpp:68
bool inside(const cartesian_point &where) const
Returns true if the point is inside the circle.
Definition circle.cpp:48
double area() const
Returns the area occupied by the circle.
Definition circle.cpp:35
cartesian_point center() const
The point at the center of the circle.
Definition circle.cpp:72
cartesian_point location(const double_angle &where) const
Returns the point on the circle that is at the angle "where".
Definition circle.cpp:41
double diameter() const
Returns the length of the circle's bisecting line.
Definition circle.cpp:37
double_angle provides a non-templated class for forward declarations.
Definition angle.h:97
Contains all of our objects for geometry and avoids name clashes.
Definition angle.h:25