The class Circle

The class Circle represents a circle of the 2D space through its center, radius and color.

class circle.Circle(center, radius, color)

Class methods:

from_dict(dic)

returns a Circle from a dict

Attributes:

color

the color of the circle, an (R, G, B) tuple

center

the center of the circle (Point)

radius

the radius of the circle (float)

Methods:

to_dict()

Returns a dict representing the circle

bounding_box()

To be implemented. Returns the bounding box of the circle (Rectangle)

rasterization(mtx)

To be implemented. Returns a list of pixels point.Point corresponding the circle’s rasterization with the given window-to -viewport transformations matrix mtx

The class supports the function str() and the comparison operator ==.

The class Circle is implemented in the file circle.py.

You can pass the tests of the following test files test-circle.txt.