feisty meow concerns codebase  2.140
geometric::ellipse Class Reference

Represents a geometric ellipse. More...

#include <ellipse.h>

Collaboration diagram for geometric::ellipse:

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

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

◆ ellipse() [1/3]

geometric::ellipse::ellipse ( )

Definition at line 31 of file ellipse.cpp.

◆ ellipse() [2/3]

geometric::ellipse::ellipse ( const cartesian_point center,
double  width_from_center,
double  height_from_center 
)

Definition at line 37 of file ellipse.cpp.

◆ ellipse() [3/3]

geometric::ellipse::ellipse ( const ellipse to_copy)

Definition at line 44 of file ellipse.cpp.

◆ ~ellipse()

geometric::ellipse::~ellipse ( )

Definition at line 50 of file ellipse.cpp.

Member Function Documentation

◆ area()

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.

◆ center() [1/2]

cartesian_point geometric::ellipse::center ( ) const

Definition at line 102 of file ellipse.cpp.

References _center.

◆ center() [2/2]

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

Definition at line 108 of file ellipse.cpp.

References _center.

◆ height_from_center() [1/2]

double geometric::ellipse::height_from_center ( ) const

Definition at line 106 of file ellipse.cpp.

References _height_from_center.

◆ height_from_center() [2/2]

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

Definition at line 113 of file ellipse.cpp.

References _height_from_center.

◆ inside()

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

◆ location()

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

◆ operator=()

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.

◆ perimeter()

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

◆ width_from_center() [1/2]

double geometric::ellipse::width_from_center ( ) const

Definition at line 104 of file ellipse.cpp.

References _width_from_center.

◆ width_from_center() [2/2]

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

Definition at line 110 of file ellipse.cpp.

References _width_from_center.

Member Data Documentation

◆ _center

cartesian_point geometric::ellipse::_center
protected

Definition at line 64 of file ellipse.h.

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

◆ _height_from_center

double geometric::ellipse::_height_from_center
protected

Definition at line 66 of file ellipse.h.

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

◆ _width_from_center

double geometric::ellipse::_width_from_center
protected

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: