CVB++ 15.0
Circle Class Referencefinal

Class representing a circle. More...

#include <cvb/circle.hpp>

Public Member Functions

 Circle (Point2D< double > center, double radius) noexcept
 Create a circle. More...
 
Point2D< double > Center () const noexcept
 Gets the center of the circle. More...
 
void SetCenter (Point2D< double > center) noexcept
 Sets the center of the circle. More...
 
double Radius () const noexcept
 Gets the radius of the circle. More...
 
void SetRadius (double radius) noexcept
 Sets the radius of the circle. More...
 
bool Contains (Point2D< double > point) const noexcept
 Check whether a point is inside or outside a circle. More...
 
bool IsOnRadius (Point2D< double > point, double epsilon) const noexcept
 Check whether a point is on the radius of a circle. More...
 
bool operator== (const Circle &circle) const noexcept
 Compares to an other circle. More...
 
bool operator!= (const Circle &circle) const noexcept
 Compares to an other circle. More...
 

Detailed Description

Class representing a circle.

For the purpose of regression and other calculations.

Constructor & Destructor Documentation

◆ Circle()

Circle ( Point2D< double >  center,
double  radius 
)
inlinenoexcept

Create a circle.

Parameters
[in]centerCenter of the circle.
[in]radiusRadius of the circle.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ Center()

Point2D< double > Center ( ) const
inlinenoexcept

Gets the center of the circle.

Returns
The center.
Exceptions
Doesnot throw any exception.

◆ Contains()

bool Contains ( Point2D< double >  point) const
inlinenoexcept

Check whether a point is inside or outside a circle.

Parameters
[in]pointPoint to be checked.
Returns
bool True if the point is inside the circle, false otherwise.
Exceptions
Doesnot throw any exception.

◆ IsOnRadius()

bool IsOnRadius ( Point2D< double >  point,
double  epsilon 
) const
inlinenoexcept

Check whether a point is on the radius of a circle.

Parameters
[in]pointPoint to be checked.
[in]epsilonMaximum allowable deviation.
Returns
True if the point lies within the allowable deviation of the circle's radius, false otherwise.
Exceptions
Doesnot throw any exception.

◆ operator!=()

bool operator!= ( const Circle circle) const
inlinenoexcept

Compares to an other circle.

Parameters
[in]circleOther circle.
Returns
True if not equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator==()

bool operator== ( const Circle circle) const
inlinenoexcept

Compares to an other circle.

Parameters
[in]circleOther circle.
Returns
True if equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ Radius()

double Radius ( ) const
inlinenoexcept

Gets the radius of the circle.

Returns
The radius.
Exceptions
Doesnot throw any exception.

◆ SetCenter()

void SetCenter ( Point2D< double >  center)
inlinenoexcept

Sets the center of the circle.

Parameters
[in]centerThe new center.
Exceptions
Doesnot throw any exception.

◆ SetRadius()

void SetRadius ( double  radius)
inlinenoexcept

Sets the radius of the circle.

Parameters
[in]radiusIf the radius is negative, the absolute value is used.
Exceptions
Doesnot throw any exception.