Add segment representation.

This commit is contained in:
Sergey Vartanov 2022-02-04 21:57:44 +03:00
parent 95f3fc14b0
commit 05e549a364

View file

@ -134,5 +134,8 @@ class Segment:
np.arccos(np.dot(vector, np.array((0.0, 1.0)))) / np.pi np.arccos(np.dot(vector, np.array((0.0, 1.0)))) / np.pi
) )
def __repr__(self):
return f"{self.point_1} -- {self.point_2}"
def __lt__(self, other: "Segment") -> bool: def __lt__(self, other: "Segment") -> bool:
return self.y < other.y return self.y < other.y