feisty meow concerns codebase  2.140
geometric::circle Class Reference

Represents a geometric circle. More...

#include <circle.h>

Public Member Functions

 circle ()
 
 circle (double radius, const cartesian_point &center)
 
 ~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...
 

Detailed Description

Represents a geometric circle.

A circle is specified by its center and its radius. The angles are measured in radians.

Definition at line 28 of file circle.h.

Constructor & Destructor Documentation

◆ circle() [1/2]

geometric::circle::circle ( )

Definition at line 28 of file circle.cpp.

◆ circle() [2/2]

geometric::circle::circle ( double  radius,
const cartesian_point center 
)

Definition at line 30 of file circle.cpp.

◆ ~circle()

geometric::circle::~circle ( )

Definition at line 33 of file circle.cpp.

Member Function Documentation

◆ area()

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

◆ center() [1/2]

cartesian_point geometric::circle::center ( ) const

The point at the center of the circle.

Definition at line 72 of file circle.cpp.

◆ center() [2/2]

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

Resets the circle's center.

Definition at line 74 of file circle.cpp.

◆ circumference()

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.

◆ diameter()

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.

◆ dimensions()

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

◆ inside()

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

◆ location()

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

◆ radius() [1/2]

double geometric::circle::radius ( ) const

Half of the circle's diameter.

Definition at line 68 of file circle.cpp.

◆ radius() [2/2]

void geometric::circle::radius ( double  to_set)

Sets the radius of the circle.

Definition at line 70 of file circle.cpp.


The documentation for this class was generated from the following files: