Circle Class Reference

#include <Geometry.h>


Public Member Functions

 Circle ()
 Circle (VecPosition pos, double dR)
void show (ostream &os=cout)
bool setCircle (VecPosition pos, double dR)
bool setRadius (double dR)
double getRadius ()
bool setCenter (VecPosition pos)
VecPosition getCenter ()
double getCircumference ()
double getArea ()
bool isInside (VecPosition pos)
int getIntersectionPoints (Circle c, VecPosition *p1, VecPosition *p2)
double getIntersectionArea (Circle c)

Private Attributes

VecPosition m_posCenter
double m_dRadius


Detailed Description

This class represents a circle. A circle is defined by one VecPosition (which denotes the center) and its radius.

Definition at line 235 of file Geometry.h.


Constructor & Destructor Documentation

Circle::Circle (  ) 

This is the constructor of a circle which initializes a circle with a radius of zero.

Definition at line 1165 of file Geometry.cpp.

References setCircle().

Circle::Circle ( VecPosition  pos,
double  dR 
)

This is the constructor of a circle.

Parameters:
pos first point that defines the center of circle
dR the radius of the circle
Returns:
circle with pos as center and radius as radius

Definition at line 1158 of file Geometry.cpp.

References setCircle().


Member Function Documentation

void Circle::show ( ostream &  os = cout  ) 

This method prints the circle information to the specified output stream in the following format: "c: (c_x,c_y), r: rad" where (c_x,c_y) denotes the center of the circle and rad the radius.

Parameters:
os output stream to which output is written.

Definition at line 1174 of file Geometry.cpp.

References m_dRadius, and m_posCenter.

bool Circle::setCircle ( VecPosition  pos,
double  dR 
)

This method sets the values of the circle.

Parameters:
pos new center of the circle
dR new radius of the circle ( > 0 )
Returns:
bool indicating whether radius was set

Definition at line 1184 of file Geometry.cpp.

References setCenter(), and setRadius().

Referenced by Circle(), and BasicPlayer::isFreeCone().

bool Circle::setRadius ( double  dR  ) 

This method sets the radius of the circle.

Parameters:
dR new radius of the circle ( > 0 )
Returns:
bool indicating whether radius was set

Definition at line 1192 of file Geometry.cpp.

References m_dRadius.

Referenced by setCircle().

double Circle::getRadius (  ) 

This method returns the radius of the circle.

Returns:
radius of the circle

Definition at line 1208 of file Geometry.cpp.

References m_dRadius.

Referenced by getArea(), Line::getCircleIntersectionPoints(), getCircumference(), getIntersectionArea(), getIntersectionPoints(), and isInside().

bool Circle::setCenter ( VecPosition  pos  ) 

This method sets the center of the circle.

Parameters:
pos new center of the circle
Returns:
bool indicating whether center was set

Definition at line 1216 of file Geometry.cpp.

References m_posCenter.

Referenced by setCircle().

VecPosition Circle::getCenter (  ) 

This method returns the center of the circle.

Returns:
center of the circle

Definition at line 1224 of file Geometry.cpp.

References m_posCenter.

Referenced by Line::getCircleIntersectionPoints(), getIntersectionArea(), and getIntersectionPoints().

double Circle::getCircumference (  ) 

This method returns the circumference of the circle.

Returns:
circumference of the circle

Definition at line 1231 of file Geometry.cpp.

References getRadius().

double Circle::getArea (  ) 

This method returns the area inside the circle.

Returns:
area inside the circle

Definition at line 1238 of file Geometry.cpp.

References getRadius().

bool Circle::isInside ( VecPosition  pos  ) 

This method returns a boolean that indicates whether 'pos' is located inside the circle.

Parameters:
pos position of which should be checked whether it is located in the circle
Returns:
bool indicating whether pos lies inside the circle

Definition at line 1250 of file Geometry.cpp.

References VecPosition::getDistanceTo(), getRadius(), and m_posCenter.

Referenced by WorldModel::getNrInSetInCircle().

int Circle::getIntersectionPoints ( Circle  c,
VecPosition p1,
VecPosition p2 
)

This method returns the two possible intersection points between two circles. This method returns the number of solutions that were found.

Parameters:
c circle with which intersection should be found
p1 will be filled with first solution
p2 will be filled with second solution
Returns:
number of solutions.

Definition at line 1261 of file Geometry.cpp.

References getCenter(), getRadius(), VecPosition::getX(), VecPosition::getY(), and VecPosition::setVecPosition().

Referenced by getIntersectionArea().

double Circle::getIntersectionArea ( Circle  c  ) 

This method returns the size of the intersection area of two circles.

Parameters:
c circle with which intersection should be determined
Returns:
size of the intersection area.

Definition at line 1315 of file Geometry.cpp.

References getCenter(), VecPosition::getDistanceTo(), getIntersectionPoints(), getRadius(), VecPosition::getVecPositionOnLineFraction(), and min().


Field Documentation

VecPosition Circle::m_posCenter [private]

Center of the circle

Definition at line 237 of file Geometry.h.

Referenced by getCenter(), isInside(), setCenter(), and show().

double Circle::m_dRadius [private]

Radius of the circle

Definition at line 238 of file Geometry.h.

Referenced by getRadius(), setRadius(), and show().


The documentation for this class was generated from the following files:
Generated on Thu Apr 26 22:45:30 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1