Circle Class Reference

#include <circle.h>

Inheritance diagram for Circle:
Shape

List of all members.

Public Member Functions

 Circle (int r, int x, int y)
 Circle (int r, Point c)
virtual std::string getType () const
virtual double getArea () const

Detailed Description

A class that represents a circle on a 2D plane. Its only member is its radius and it inherits all of its functionality from the Shape class.

Author:
Brent Nash

Constructor & Destructor Documentation

Circle::Circle ( int  r,
int  x,
int  y 
)

Overloaded constructor that takes in a radius and an (x,y) coordinate.

Parameters:
r The radius of the circle (must be greater than 0)
x The X coordinate of the circle's center point in 2D space
y The Y coordinate of the circle's center point in 2D space
Circle::Circle ( int  r,
Point  c 
)

Overloaded constructor that takes in a radius and a center Point.

Parameters:
r The radius of the circle (must be greater than 0)
c The center point of the circle in 2D space

Member Function Documentation

double Circle::getArea (  )  const [virtual]

Virtual function overridden from Shape. Returns the area of the circle as PI*radius*radius.

Precondition:
The radius must be set to a valid number.
Postcondition:
Does not change the object
Returns:
The area of the circle as a floating point number.

Implements Shape.

string Circle::getType (  )  const [virtual]

Virtual function overridden from Shape. Returns a string indicating what type of shape this object is.

Precondition:
None
Postcondition:
Does not change the object
Returns:
The string "Circle"

Implements Shape.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends

Generated by  doxygen 1.6.2
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees