Class Circle

java.lang.Object
   |
   +----Circle

public class Circle
extends Object
Simple circle class to do basic circle arithmetic

Version:
1.0
Author:
Adrian Colyer

Variable Index

 o centre
The centre of the circle
 o radius
The radius of the circle

Constructor Index

 o Circle(Point, int)
Circle constructor to create a new instance of the circle class passing in a radius and centre.

Method Index

 o area()
Calculate the area of the circle.
 o circumference()
Calculate the circumference of the circle
 o setCentre(int, int)
Set the centre of the circle.
 o setRadius(int)
Set the radius of the circle.

Variables

 o radius
 protected int radius
The radius of the circle

 o centre
 protected Point centre
The centre of the circle

Constructors

 o Circle
 public Circle(Point centre,
               int radius)
Circle constructor to create a new instance of the circle class passing in a radius and centre.

Methods

 o circumference
 public double circumference()
Calculate the circumference of the circle

Returns:
the circumference
See Also:
area
 o area
 public double area()
Calculate the area of the circle.

Returns:
the area
See Also:
circumference
 o setCentre
 public void setCentre(int x,
                       int y)
Set the centre of the circle.

Parameters:
x - the x co-ordinate
y - the y co-ordinate
 o setRadius
 public void setRadius(int r)
Set the radius of the circle.