def rect_center(rect):
    """Return the centre of a rectangle as an (x, y) tuple."""

    left = min(rect[0], rect[2])
    top = min(rect[1], rect[3])

    return (left + abs(((rect[2] - rect[0]) / 2)),
            top + abs(((rect[3] - rect[1]) / 2)))