51 lines
999 B
Python
51 lines
999 B
Python
from typing import List
|
|
|
|
|
|
class Pos:
|
|
def __init__(self, x: float = 0, y: float = 0):
|
|
self.x_pos = x
|
|
self.y_pos = y
|
|
pass
|
|
|
|
def make_copy(self) -> 'Pos':
|
|
return Pos(self.x_pos, self.y_pos)
|
|
|
|
|
|
class Point:
|
|
def __init__(self, name:str):
|
|
self.point_name = name
|
|
pass
|
|
|
|
def name(self) -> str:
|
|
return self.point_name
|
|
|
|
def make_copy(self) -> 'Point':
|
|
return Point(self.point_name)
|
|
|
|
|
|
class Line:
|
|
def __init__(self, p0: Point, p1: Point):
|
|
self.point_set = [p0, p1]
|
|
pass
|
|
|
|
def points(self) -> List[Point]:
|
|
return self.point_set
|
|
|
|
def make_copy(self) -> 'Line':
|
|
return Line(self.points()[0].make_copy(), self.points()[1].make_copy())
|
|
|
|
|
|
class Arrow(Line):
|
|
def __init__(self, start: Point, end: Point):
|
|
Line.__init__(self, start, end)
|
|
pass
|
|
|
|
def start_point(self):
|
|
return self.point_set[0]
|
|
|
|
def end_point(self):
|
|
return self.point_set[1]
|
|
|
|
pass
|
|
|