def shift2d(x,w,a,b):
    """Shift a 2d quadrature rule to the box defined by the tuples a and b"""

    xs=[[a[0]],[a[1]]]+x*[[b[0]-a[0]],[b[1]-a[1]]]
    ws=w*(b[0]-a[0])*(b[1]-a[1])
    return xs,ws