feisty meow concerns codebase
2.140
|
Represents a geometric circle. More...
#include <circle.h>
Public Member Functions | |
circle () | |
circle (double radius, const cartesian_point ¢er) | |
~circle () | |
double | area () const |
Returns the area occupied by the circle. More... | |
double | circumference () const |
Returns the perimeter for the circle. More... | |
double | diameter () const |
Returns the length of the circle's bisecting line. More... | |
bool | inside (const cartesian_point &where) const |
Returns true if the point is inside the circle. More... | |
cartesian_point | location (const double_angle &where) const |
Returns the point on the circle that is at the angle "where". More... | |
cartesian_rectangle | dimensions () const |
Returns a bounding box around the circle. More... | |
double | radius () const |
Half of the circle's diameter. More... | |
void | radius (double to_set) |
Sets the radius of the circle. More... | |
cartesian_point | center () const |
The point at the center of the circle. More... | |
void | center (const cartesian_point &to_set) |
Resets the circle's center. More... | |
Represents a geometric circle.
A circle is specified by its center and its radius. The angles are measured in radians.
geometric::circle::circle | ( | ) |
Definition at line 28 of file circle.cpp.
geometric::circle::circle | ( | double | radius, |
const cartesian_point & | center | ||
) |
Definition at line 30 of file circle.cpp.
geometric::circle::~circle | ( | ) |
Definition at line 33 of file circle.cpp.
double geometric::circle::area | ( | ) | const |
Returns the area occupied by the circle.
Definition at line 35 of file circle.cpp.
References PI_APPROX, and basis::square().
cartesian_point geometric::circle::center | ( | ) | const |
The point at the center of the circle.
Definition at line 72 of file circle.cpp.
void geometric::circle::center | ( | const cartesian_point & | to_set | ) |
Resets the circle's center.
Definition at line 74 of file circle.cpp.
double geometric::circle::circumference | ( | ) | const |
Returns the perimeter for the circle.
The circumference is the length of a virtual string around the circle.
Definition at line 39 of file circle.cpp.
References PI_APPROX.
double geometric::circle::diameter | ( | ) | const |
Returns the length of the circle's bisecting line.
This is the length of a line segment that is circumscribed by the circle and which passes through the center of the circle.
Definition at line 37 of file circle.cpp.
cartesian_rectangle geometric::circle::dimensions | ( | ) | const |
Returns a bounding box around the circle.
Definition at line 54 of file circle.cpp.
References location(), PI_APPROX, geometric::point< numeric_type >::x(), and geometric::point< numeric_type >::y().
bool geometric::circle::inside | ( | const cartesian_point & | where | ) | const |
Returns true if the point is inside the circle.
Definition at line 48 of file circle.cpp.
References geometric::point< numeric_type >::distance().
cartesian_point geometric::circle::location | ( | const double_angle & | where | ) | const |
Returns the point on the circle that is at the angle "where".
Definition at line 41 of file circle.cpp.
References geometric::angle< contents >::get(), and geometric::RADIANS.
Referenced by dimensions().
double geometric::circle::radius | ( | ) | const |
Half of the circle's diameter.
Definition at line 68 of file circle.cpp.
void geometric::circle::radius | ( | double | to_set | ) |
Sets the radius of the circle.
Definition at line 70 of file circle.cpp.