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
-
centre
- The centre of the circle
-
radius
- The radius of the circle
-
Circle(Point, int)
- Circle constructor to create a new instance of the circle class passing in
a radius and centre.
-
area()
- Calculate the area of the circle.
-
circumference()
- Calculate the circumference of the circle
-
setCentre(int, int)
- Set the centre of the circle.
-
setRadius(int)
- Set the radius of the circle.
radius
protected int radius
- The radius of the circle
centre
protected Point centre
- The centre of the circle
Circle
public Circle(Point centre,
int radius)
- Circle constructor to create a new instance of the circle class passing in
a radius and centre.
circumference
public double circumference()
- Calculate the circumference of the circle
- Returns:
- the circumference
- See Also:
- area
area
public double area()
- Calculate the area of the circle.
- Returns:
- the area
- See Also:
- circumference
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
setRadius
public void setRadius(int r)
- Set the radius of the circle.