diff --git a/src/analyzer/epoint.py b/src/analyzer/epoint.py --- a/src/analyzer/epoint.py +++ b/src/analyzer/epoint.py @@ -69,5 +69,15 @@ class EPoint: elif key==1: return self.y raise IndexError(key) + def __hash__(self): + return hash((self.x,self.y)) + + def __lt__(self,a): return self.xa.x or (self.x==a.x and self.y>a.y) + def __ge__(self,a): return self.x>a.x or (self.x==a.x and self.y>=a.y) + def __eq__(self,a): return self.x==a.x and self.y==a.y + def __ne__(self,a): return self.x!=a.x or self.y!=a.y + def __str__(self): return "({0},{1})".format(round(self.x,3),round(self.y,3)) def __repr__(self): return "EPoint({0},{1})".format(round(self.x,3),round(self.y,3))