feisty meow concerns codebase
2.140
|
Represents a geometric ellipse. More...
#include <ellipse.h>
Public Member Functions | |
ellipse () | |
ellipse (const cartesian_point ¢er, double width_from_center, double height_from_center) | |
ellipse (const ellipse &to_copy) | |
~ellipse () | |
ellipse & | operator= (const ellipse &to_copy) |
double | area () const |
Returns the area occupied by the ellipse. More... | |
double | perimeter () const |
Returns the perimeter for the ellipse. More... | |
bool | inside (const cartesian_point &where) const |
Returns true if the point is inside the ellipse. More... | |
cartesian_point | location (const double_angle &where) const |
Describes the locus of the ellipse (basically, where it lives). More... | |
cartesian_point | center () const |
double | width_from_center () const |
double | height_from_center () const |
void | center (const cartesian_point &to_set) |
void | width_from_center (double to_set) |
void | height_from_center (double to_set) |
Protected Attributes | |
cartesian_point | _center |
double | _width_from_center |
double | _height_from_center |
Represents a geometric ellipse.
An ellipse is specified by its height, width and center.
geometric::ellipse::ellipse | ( | ) |
Definition at line 31 of file ellipse.cpp.
geometric::ellipse::ellipse | ( | const cartesian_point & | center, |
double | width_from_center, | ||
double | height_from_center | ||
) |
Definition at line 37 of file ellipse.cpp.
geometric::ellipse::ellipse | ( | const ellipse & | to_copy | ) |
Definition at line 44 of file ellipse.cpp.
geometric::ellipse::~ellipse | ( | ) |
Definition at line 50 of file ellipse.cpp.
double geometric::ellipse::area | ( | ) | const |
Returns the area occupied by the ellipse.
Definition at line 61 of file ellipse.cpp.
References _height_from_center, _width_from_center, basis::absolute_value(), and PI_APPROX.
cartesian_point geometric::ellipse::center | ( | ) | const |
Definition at line 102 of file ellipse.cpp.
References _center.
void geometric::ellipse::center | ( | const cartesian_point & | to_set | ) |
Definition at line 108 of file ellipse.cpp.
References _center.
double geometric::ellipse::height_from_center | ( | ) | const |
Definition at line 106 of file ellipse.cpp.
References _height_from_center.
void geometric::ellipse::height_from_center | ( | double | to_set | ) |
Definition at line 113 of file ellipse.cpp.
References _height_from_center.
bool geometric::ellipse::inside | ( | const cartesian_point & | where | ) | const |
Returns true if the point is inside the ellipse.
Definition at line 94 of file ellipse.cpp.
References _center, geometric::point< numeric_type >::distance(), location(), geometric::RADIANS, and geometric::point< numeric_type >::y().
cartesian_point geometric::ellipse::location | ( | const double_angle & | where | ) | const |
Describes the locus of the ellipse (basically, where it lives).
Returns the point on the ellipse that lies on a ray from the center of the ellipse directed at an angle "where".
Definition at line 72 of file ellipse.cpp.
References _center, _height_from_center, _width_from_center, geometric::DEGREES, geometric::angle< contents >::get(), geometric::point< numeric_type >::set(), basis::square(), geometric::angle< contents >::tangent(), geometric::point< numeric_type >::x(), and geometric::point< numeric_type >::y().
Referenced by inside().
Definition at line 52 of file ellipse.cpp.
References _center, _height_from_center, and _width_from_center.
double geometric::ellipse::perimeter | ( | ) | const |
Returns the perimeter for the ellipse.
This is the length of the virtual string around the ellipse. The returned value is an approximation.
Definition at line 64 of file ellipse.cpp.
References _height_from_center, _width_from_center, PI_APPROX, and basis::square().
double geometric::ellipse::width_from_center | ( | ) | const |
Definition at line 104 of file ellipse.cpp.
References _width_from_center.
void geometric::ellipse::width_from_center | ( | double | to_set | ) |
Definition at line 110 of file ellipse.cpp.
References _width_from_center.
|
protected |
Definition at line 64 of file ellipse.h.
Referenced by center(), inside(), location(), and operator=().
|
protected |
Definition at line 66 of file ellipse.h.
Referenced by area(), height_from_center(), location(), operator=(), and perimeter().
|
protected |
Definition at line 65 of file ellipse.h.
Referenced by area(), location(), operator=(), perimeter(), and width_from_center().