#NEWLINE# def __init__( self , xmin , xmax , ymin , ymax , cell_width , cell_height ) : #NEWLINE# #INDENT# '\n        Cell width and height have impact on performance.\n        For objects with same with, and with width==height, a good value\n        is 1.25 * (object width).\n        For mixed widths, a good guess can be\n        ~ 1.25 * { width(object): all objects not exceptionlly big}\n\n        :Parameters:\n            `xmin` : float\n                minimum x coordinate for a point in world\n            `xmax` : float\n                maximum x coordinate for a point in world\n            `ymin` : float\n                minimum y coordinate for a point in world\n            `ymax` : float\n                maximum y coordinate for a point in world\n            `cell_width` : float\n                width for the rectangles the space will be broken\n            `cell_height` : float\n                height for the rectangles the space will be broken\n        ' #NEWLINE# self . xmin = xmin #NEWLINE# self . xmax = xmax #NEWLINE# self . ymin = ymin #NEWLINE# self . ymax = ymax #NEWLINE# self . cell_width = cell_width #NEWLINE# self . cell_height = cell_height #NEWLINE# cols = int ( math . ceil ( ( ( xmax - xmin ) / cell_width ) ) ) #NEWLINE# rows = int ( math . ceil ( ( ( ymax - ymin ) / cell_height ) ) ) #NEWLINE# self . cols = cols #NEWLINE# self . rows = rows #NEWLINE# numbuckets = ( cols * rows ) #NEWLINE# self . buckets = [ set ( ) for k in range ( numbuckets ) ]