/*******************************************************************************
Author:				Rebecca Hasti, hasti@cs.wisc.edu
					copyright 2000, all rights reserved
Course:				CS 302, Summer 2000

Compiler:			Metrowerks CodeWarrior (JDK 1.2)
Platform:			Windows NT 4.0 (or Windows 95)
*******************************************************************************/

/**
 * An object of the Circle class represents a circle in the xy plane.
 * A circle consists of a center point and a radius.
 *
 * Bugs:	none known
 **/
class Circle {

	////////////////////////////////////////
	// Data Members
	////////////////////////////////////////
	
	private Point center;		// the center of the circle
	private double radius;		// the radius of the circle, >= 0
	
	////////////////////////////////////////
	// Constructors
	////////////////////////////////////////
	
	/**
	 * Constructs a circle with the given center and radius (radius >= 0).
	 * @param centerPt 	the center of the circle
	 * @param r 		the radius of the circle
	 **/ 
	public Circle(Point centerPt, double r) {
		center = centerPt;
		radius = r;
	}
	
	////////////////////////////////////////
	// Public Methods
	// 	Point	getCenter()
	//	double	getRadius()
	//	void	setCenter(Point newCenter)
	//	void 	setRadius(double newR)
	//	double	computeArea()
	//	double	computeCircumference()
	////////////////////////////////////////

	/** 
	 * Returns the center point of the circle.
	 * @return the center of the circle
	 **/
	public Point getCenter() {
		return center;
	}
	
	/**
	 * Returns the radius of the circle.
	 * @return the radius of the circle.
	 **/
	public double getRadius() {
		return radius;
	}
	
	/**
	 * Sets the center of the circle to the given point.
	 * @param newCenter	the new center point of the circle
	 **/
	public void setCenter(Point newCenter) {
		center = newCenter;
	}
	
	/**
	 * Sets the radius of the circle to the given radius.
	 * Note: the radius is assumed to be >= 0.
	 * @param newR		the new radius of the circle (>= 0)
	 **/
	public void setRadius(double newR) {
		radius = newR;
	}
	
	/**
	 * Computes the area of the circle.
	 * @return the area of the circle.
	 **/
	public double computeArea() {
		return Math.PI * radius * radius;
	}
	
	/**
	 * Computes the circumference of the circle.
	 * @return the circumference of the circle
	 **/
	public double computeCircumference() {
		return 2 * Math.PI * radius;
	}
	
}
