-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircle.java
More file actions
37 lines (34 loc) · 756 Bytes
/
Circle.java
File metadata and controls
37 lines (34 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Write a description of class Circle here.
*
* @author (your name)
* @version (a version number or a date)
*/
import gpdraw.*;
public class Circle
{
// instance variables - replace the example below with your own
private double x;
private double y;
private double radius;
private SketchPad paper;
private DrawingTool pen;
/**
* Constructor for objects of class Circle
*/
public Circle(double myX, double myY,double newRadi)
{
// initialise instance variables
radius = newRadi;
x = myX;
y = myY;
pen = new DrawingTool();
}
public void draw()
{
pen.up();
pen.move(x, y);
pen.down();
pen.drawCircle(radius);
}
}