The class Point

The class Point point represents a point of the 2D space.

class point.Point(x, y)

Class methods:

from_dict(dic)

returns a point from a dict {“x”: x_value, “y”: y_value}

Instance attributes

x

the x coordinate of the point float or int

y

the y coordinate of the point float or int

Instance methods:

to_dict()

Returns a dict {“x”: x_value, “y”: y_value}

rasterization(mtx):

Given a geometrical transformation matrix, it returns a Point result of the window-to-viewport transform of the point

The class suports the method str and the operator ==.

The class Point is implemented in the file point.py.

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