feisty meow concerns codebase 2.140
ellipse.h
Go to the documentation of this file.
1#ifndef ELLIPSE_CLASS
2#define ELLIPSE_CLASS
3
4/*****************************************************************************\
5* *
6* Name : ellipse *
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
18namespace geometric {
19
20// forward.
21class cartesian_point;
22class double_angle;
23
25
28{
29public:
30 ellipse();
32 double height_from_center);
33 ellipse(const ellipse &to_copy);
34
35 ~ellipse();
36
37 ellipse &operator = (const ellipse &to_copy);
38
39 double area() const;
41
42 double perimeter() const;
44
47 bool inside(const cartesian_point &where) const;
49
50 cartesian_point location(const double_angle &where) const;
52
55 cartesian_point center() const;
56 double width_from_center() const;
57 double height_from_center() const;
58
59 void center(const cartesian_point &to_set);
60 void width_from_center(double to_set);
61 void height_from_center(double to_set);
62
63protected:
67};
68
69} // namespace.
70
71#endif
72
Provides a geometric point that use double floating points numbers.
double_angle provides a non-templated class for forward declarations.
Definition angle.h:97
Represents a geometric ellipse.
Definition ellipse.h:28
cartesian_point _center
Definition ellipse.h:64
double area() const
Returns the area occupied by the ellipse.
Definition ellipse.cpp:61
double width_from_center() const
Definition ellipse.cpp:104
cartesian_point location(const double_angle &where) const
Describes the locus of the ellipse (basically, where it lives).
Definition ellipse.cpp:72
cartesian_point center() const
Definition ellipse.cpp:102
bool inside(const cartesian_point &where) const
Returns true if the point is inside the ellipse.
Definition ellipse.cpp:94
ellipse & operator=(const ellipse &to_copy)
Definition ellipse.cpp:52
double _height_from_center
Definition ellipse.h:66
double height_from_center() const
Definition ellipse.cpp:106
double perimeter() const
Returns the perimeter for the ellipse.
Definition ellipse.cpp:64
double _width_from_center
Definition ellipse.h:65
Contains all of our objects for geometry and avoids name clashes.
Definition angle.h:25