forked from jordi-petit/ap2-moduls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCircle.hh
53 lines (32 loc) · 1.2 KB
/
Circle.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef Circle_hh
#define Circle_hh
#include "Point.hh"
/** The Circle class stores a circle and provides some usefull operations for it. */
class Circle {
public:
/** Constructor. Creates a circle with a center c and a radius r.
The center point c is optional and defaults to (0,0).
Precondition: r ≥ 0. */
Circle (double r=0, const Point& c=Point(0,0));
/** Gets the center of this circle. */
Point center () const;
/** Gets the radius of this circle. */
double radius () const;
/** Returns the area of this circle. */
double area () const;
/** Compares this circle to circle c. */
bool operator== (const Circle& c) const;
/** Compares this circle to circle c. */
bool operator!= (const Circle& c) const;
/** Scales this circle with a factor s >= 0. */
void scale (double s);
/** Moves the center of this circle to some point. */
void move_to (const Point& p);
/** Check whether point p is contained in this circle. */
bool contains (const Point& p) const;
/** Check whether circle c is fully contained in this circle. */
bool contains (const Circle& c) const;
private:
/** Fill yourself !!! **/
};
#endif