def polygon_bounds(points):
 (minx, miny) = (points[0][0], points[0][1])
 (maxx, maxy) = (minx, miny)
 for p in points:
  minx = min(minx, p[0])
  maxx = max(maxx, p[0])
  miny = min(miny, p[1])
  maxy = max(maxy, p[1])
 return (minx, miny, (maxx - minx), (maxy - miny))

def polygon_bounds ( points ) : ( minx , miny ) = ( points [ 0 ] [ 0 ] , points [ 0 ] [ 1 ] ) ( maxx , maxy ) = ( minx , miny ) for p in points : minx = min ( minx , p [ 0 ] ) maxx = max ( maxx , p [ 0 ] ) miny = min ( miny , p [ 1 ] ) maxy = max ( maxy , p [ 1 ] ) return ( minx , miny , ( maxx - minx ) , ( maxy - miny ) )
return bounding box of a polygon in form .