Add and clean proper objects for Polyline, Point2D, Circle

This commit is contained in:
2024-06-11 01:29:07 +02:00
parent 23fa587292
commit 0c18414176
4 changed files with 160 additions and 70 deletions

View 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})"