def within_hull(point, hull):
    '''Return true if the point is within the convex hull'''
    h_prev_pt = hull[-1,:]
    for h_pt in hull:
        if np.cross(h_pt-h_prev_pt, point - h_pt) >= 0:
            return False
        h_prev_pt = h_pt
    return True
def within_hull ( point , hull ) : h_prev_pt = hull [ - 1 , : ] for h_pt in hull : if np . cross ( h_pt - h_prev_pt , point - h_pt ) >= 0 : return False h_prev_pt = h_pt return True
Return true if the point is within the convex hull