27 using namespace basis;
33 _width_from_center(1),
34 _height_from_center(1)
38 double a_height_from_center)
40 _width_from_center(a_width_from_center),
41 _height_from_center(a_height_from_center)
46 _width_from_center(0),
47 _height_from_center(0)
54 if (
this == &to_copy)
return *
this;
77 double denom = sqrt(
square(b) +
square(a) * a_multiplier);
85 double adjustment = where.
get(
DEGREES) - double(ang);
87 double adjusted_ang = ang + adjustment;
88 if ( (adjusted_ang < 270.0) && (adjusted_ang > 90.0) )
89 to_return.
set(to_return.
x() * -1.0, to_return.
y());
contents get(angular_units unit) const
retrieves the current angular measure.
contents tangent() const
returns the tan function of this angle.
Provides a geometric point that use double floating points numbers.
double_angle provides a non-templated class for forward declarations.
Represents a geometric ellipse.
double area() const
Returns the area occupied by the ellipse.
double width_from_center() const
cartesian_point location(const double_angle &where) const
Describes the locus of the ellipse (basically, where it lives).
cartesian_point center() const
bool inside(const cartesian_point &where) const
Returns true if the point is inside the ellipse.
ellipse & operator=(const ellipse &to_copy)
double _height_from_center
double height_from_center() const
double perimeter() const
Returns the perimeter for the ellipse.
double _width_from_center
void set(numeric_type x, numeric_type y)
numeric_type distance(const point &p2) const
Returns the distance between ‘this’ and the second point ‘p2’.
#define PI_APPROX
An approximation of the fundamental circular constant.
The guards collection helps in testing preconditions and reporting errors.
type square(const type &a)
Returns the square of the object (which is a * a).
type absolute_value(type a)
Returns a if a is non-negative, and returns -a otherwise.
Contains all of our objects for geometry and avoids name clashes.