def box(points):
    """Obtain a tight fitting axis-aligned box around point set"""
    xmin = min(points, key=lambda x: x[0])[0]
    ymin = min(points, key=lambda x: x[1])[1]
    xmax = max(points, key=lambda x: x[0])[0]
    ymax = max(points, key=lambda x: x[1])[1]
    return (xmin, ymin), (xmax, ymax)