geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Public Attributes | List of all members
Circle2D Class Reference

A circle represented by center point coordinate and radius. More...

#include <Circle2D.h>

Inheritance diagram for Circle2D:
Inheritance graph
Collaboration diagram for Circle2D:
Collaboration graph

Public Member Functions

 Circle2D (double x, double y, double r)
 
 Circle2D (const Point2D ctr, double r)
 
 Circle2D ()
 
bool overlap (const Circle2D &oth) const
 
- Public Member Functions inherited from Point2D
 Point2D (double x, double y)
 
 Point2D (const double xandy[2])
 
 Point2D ()
 
Point2D to (const Point2D &oth) const
 
Point2D plus (const Point2D &oth) const
 Add this point (as a vector) to another point. More...
 
Point2D turn90 () const
 
Point2D apply (const RotTrans2D &rt) const
 
double dist (const Point2D &oth) const
 
double len () const
 
double dotprod (const Point2D &oth) const
 
Point2Doperator-= (const Point2D &rhs)
 Subtract another point, interpreting both points as vectors. More...
 
Point2Doperator+= (const Point2D &rhs)
 Add another point, interpreting both points as vectors. More...
 

Public Attributes

double rad
 The radius. More...
 
- Public Attributes inherited from Point2D
double coord [2]
 The two Cartesian coordinates x and y of the point. More...
 

Detailed Description

A circle represented by center point coordinate and radius.

Since
2013-07-03
Author
Richard J. Mathar

Constructor & Destructor Documentation

Circle2D::Circle2D ( double  x,
double  y,
double  r 
)

Create a circle given its Cartesian coordinates of the center and radius.

Parameters
xThe x coordinate of the center.
yThe y coordinat of the centere
rThe radius.
Circle2D::Circle2D ( const Point2D  ctr,
double  r 
)

Create a circle given the mid point and the radius.

Parameters
ctrThe center point of the cricle.
rThe radius of the circle.
Circle2D::Circle2D ( )

Create a circle of zero radius at the origin of coordinates.

Member Function Documentation

bool Circle2D::overlap ( const Circle2D oth) const

Check whether this circle overlaps with another one.

Parameters
othThe companion circle which may intersect this one.
Returns
True if the circles overlap. False if they don't overlap or touch only at a point.

Member Data Documentation

double Circle2D::rad

The radius.