Add and clean proper objects for Polyline, Point2D, Circle
This commit is contained in:
16
networks/geometry/Point2D.py
Normal file
16
networks/geometry/Point2D.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Type
|
||||
|
||||
|
||||
class Point2D:
|
||||
def __init__(self, x: int, y: int):
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
def copy(self):
|
||||
return Point2D(self.x, self.y)
|
||||
|
||||
def coordinates(self):
|
||||
return (self.x, self.y)
|
||||
|
||||
def __repr__(self):
|
||||
return f"Point2D(x: {self.x}, y: {self.y})"
|
||||
Reference in New Issue
Block a user