## Such sweet code:

```def Abcx(row,c,left,right):
a = dist(row,left)
b = dist(row,right)
x = (a**2 + c**2 - b**2)* 1.0 / (2*c + 1.0/The.inf)
y = (a**2 - x**2)**0.5
return Thing(x=x,y=y,row=row,a=a,b=b)

z     = one(t.rows)
left  = furthest(z)
right = furthest(left)
out = []
return out

t.left  = l
t.right = r
c = t.c = dist(l,r)
x,y     = [],[]
for row in t.rows:
xy = Abcx(row,c,l,r)
if   xy.a > t.c : return quad1(t,l,row,out,demo)
elif xy.b > t.c : return quad1(t,row,r,out,demo)
else:
x += [xy]
y += [xy]
x = sorted(x,key=lambda z:z.x)
y = sorted(x,key=lambda z:z.y)
hi   = len(x)
stop = The.enough(hi)
print "stop>",stop
tile(x,y,0,hi,0,hi,out,stop,demo,2)

def tile(x,y,x0,x2,y0,y2,out,stop,demo,depth=0):
def tile1(x0,x2,y0,y2,out):
tmp = []
for one in x[x0:x2]:
for two in y[y0:y2]:
if one.row.row == two.row.row:
tmp += [one]
if demo:
print '--|'*depth,len(tmp)
if len(tmp) > stop:
tile(x,y,x0,x2,y0,y2,out,stop,demo,depth+1)
else:
out += [tmp] ```
```
x1 = x0 + (x2 - x0)/2
y1 = y0 + (y2 - y0)/2
tile1( x0,x1, y0,y1 ,out)
tile1( x0,x1, y1,y2 ,out)
tile1( x1,x2, y0,y1 ,out)
tile1( x1,x2, y1,y2 ,out)
```