def convex_hull(points):
    
    assert len(points) > 2, "need at least 3 points to form a convex hull"
    
    ### Find lowest rightmost point
    p0 = points[0]
    for p in points[1:]:
        if p[Y] < p0[Y]:
            p0 = p
        elif p[Y] == p0[Y] and p[X] > p0[X]:
            p0 = p
    points.remove(p0)
    
    ### Sort the points angularly about p0 as center
    f = partial(is_left, p0)
    points.sort(cmp = f)
    points.reverse()
    points.insert(0, p0)
    
    ### Find the hull points
    hull = [p0, points[1]]
    
    for p in points[2:]:
        
        pt1 = hull[-1]
        pt2 = hull[-2]
        l = is_left(pt2, pt1, p) 
        if l > 0:
            hull.append(p)
        else:
            while l <= 0 and len(hull) > 2:
                hull.pop()
                pt1 = hull[-1]
                pt2 = hull[-2]
                l = is_left(pt2, pt1, p)
            hull.append(p)
    return hull
Color background in a range according to the data.
dataset/ETHPy150Open estevaofon/angry-birds-python/pymunk-4.0.0/pymunk/util.py/convex_hull--crossover with--dataset/ETHPy150Open pydata/pandas/pandas/formats/style.py/Styler._background_gradient