parent
8db417a134
commit
64dca171b4
|
@ -1,19 +1,19 @@
|
|||
class Extents:
|
||||
__slots__ = "xmin ymin xmax ymax".split()
|
||||
|
||||
def __init__(self,xmin=float('inf'),ymin=float('inf'),xmax=float('-inf'),ymax=float('-inf')) -> None:
|
||||
def __init__(self, xmin: float = float('inf'), ymin: float = float('inf'), xmax: float = float('-inf'), ymax: float = float('-inf')) -> None:
|
||||
self.xmin = xmin
|
||||
self.ymin = ymin
|
||||
self.xmax = xmax
|
||||
self.ymax = ymax
|
||||
|
||||
def add(self,x,y):
|
||||
def add(self, x: float, y: float) -> None:
|
||||
self.xmin = min(self.xmin, x)
|
||||
self.xmax = max(self.xmax, x)
|
||||
self.ymin = min(self.ymin, y)
|
||||
self.ymax = max(self.ymax, y)
|
||||
|
||||
def extend(self,l):
|
||||
def extend(self, l) -> None:
|
||||
for x, y in l:
|
||||
self.add(x, y)
|
||||
|
||||
|
|
Loading…
Reference in New Issue