def get_rect_from_points(point_a, point_b):
    """Return rect-like tuple from given points.

    Each of the four elements of the tuple is an integer
    representing, respectively, the left coordinate, the
    top coordinate, the width and the height.
    """
    ### get tuples gathering x's and y's from both points
    xs, ys = zip(point_a, point_b)

    ### calculate left and right, then width

    left, right = (func(xs) for func in (min, max))

    width = right - left

    ### calculate top and bottom, then height

    top, bottom = (func(ys) for func in (min, max))

    height = bottom - top

    ### finally return the tuple
    return (left, top, width, height)
Return rect-like tuple from given points.

    Each of the four elements of the tuple is an integer
    representing, respectively, the left coordinate, the
    top coordinate, the width and the height.
    
nodezator/ourstdlibs/mathutils.py