geometric::ellipse Class Reference

Represents a geometric ellipse. More...

#include <ellipse.h>

Collaboration diagram for geometric::ellipse:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ellipse ()
 ellipse (const cartesian_point &center, double width_from_center, double height_from_center)
 ellipse (const ellipse &to_copy)
 ~ellipse ()
ellipseoperator= (const ellipse &to_copy)
double area () const
 Returns the area occupied by the ellipse.
double perimeter () const
 Returns the perimeter for the ellipse.
bool inside (const cartesian_point &where) const
 Returns true if the point is inside the ellipse.
cartesian_point location (const double_angle &where) const
 Describes the locus of the ellipse (basically, where it lives).
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

Detailed Description

Represents a geometric ellipse.

An ellipse is specified by its height, width and center.

Definition at line 27 of file ellipse.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

void geometric::ellipse::center ( const cartesian_point to_set  ) 

Definition at line 108 of file ellipse.cpp.

References _center.

cartesian_point geometric::ellipse::center (  )  const

Definition at line 102 of file ellipse.cpp.

References _center.

void geometric::ellipse::height_from_center ( double  to_set  ) 

Definition at line 113 of file ellipse.cpp.

References _height_from_center.

double geometric::ellipse::height_from_center (  )  const

Definition at line 106 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().

ellipse & geometric::ellipse::operator= ( const ellipse to_copy  ) 

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().

void geometric::ellipse::width_from_center ( double  to_set  ) 

Definition at line 110 of file ellipse.cpp.

References _width_from_center.

double geometric::ellipse::width_from_center (  )  const

Definition at line 104 of file ellipse.cpp.

References _width_from_center.


Member Data Documentation

Definition at line 64 of file ellipse.h.

Referenced by center(), inside(), location(), and operator=().

Definition at line 66 of file ellipse.h.

Referenced by area(), height_from_center(), location(), operator=(), and perimeter().

Definition at line 65 of file ellipse.h.

Referenced by area(), location(), operator=(), perimeter(), and width_from_center().


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 04:25:35 2012 for hoople2 project by  doxygen 1.6.3