Circle Class
Create the Circle class which is derived from Shape with the following properties:
- Create an integer or float instance variable for a radius
- Create a constructor which takes four arguments:
- x coordinate
- y coordinate
- radius
- canvas (PApplet)
- Invoke the super constructor with x and y coordinates and the canvas as parameters.
-
Create a draw method which overrides Shape's draw method.
You should call the ellipse() method defined in PApplet.
The ellipse() method takes the following four argument (x , y , width , height).
Since a circle is a special form of an ellipse with both width and height equal, pass
the radius as both width and height to the ellipse() method.
Use Shape's canvas accessor to get a handle on Shape's PApplet.