return dist
dists = []
for i in range(len(points) - 1):
    dists.append(dist(points[i][0], points[i][1], points[i + 1][0], points[
        i + 1][1], p[0], p[1]))
dist = min(dists)
Computing the distance to a convex hull