algorithms/convex_hull.py
def jarvis_march(points):
    """
    Returns the convex hull of the given set of point

    :param points:
    :return: ordered list of the indexes of the point
    """
    n_points = len(points[0])
    convex_hull_indexes = [min_point(points, n_points)]
    next_point = get_next_point(points, n_points, convex_hull_indexes[0])

    while next_point != convex_hull_indexes[0]:
        convex_hull_indexes.append(next_point)
        next_point = get_next_point(points, n_points, convex_hull_indexes[-1])

    # Convert the convex hull to coordinates
    convex_hull_x = []
    convex_hull_y = []

    for point in convex_hull_indexes:
        convex_hull_x.append(points[0][point])
        convex_hull_y.append(points[1][point])

    return convex_hull_x, convex_hull_y

    Returns the convex hull of the given set of point

    :param points:
    :return: ordered list of the indexes of the point
    
Returns the convex hull of the given set of point
Returns the convex hull of the given set of point
def jarvis_march(points):
    n_points = len(points[0])
    convex_hull_indexes = [min_point(points, n_points)]
    next_point = get_next_point(points, n_points, convex_hull_indexes[0])
    while next_point != convex_hull_indexes[0]:
        convex_hull_indexes.append(next_point)
        next_point = get_next_point(points, n_points, convex_hull_indexes[-1])
    convex_hull_x = []
    convex_hull_y = []
    for point in convex_hull_indexes:
        convex_hull_x.append(points[0][point])
        convex_hull_y.append(points[1][point])
    return convex_hull_x, convex_hull_y
def jarvis_march ( points ) : n_points = len ( points [ 0 ] ) convex_hull_indexes = [ min_point ( points , n_points ) ] next_point = get_next_point ( points , n_points , convex_hull_indexes [ 0 ] ) while next_point != convex_hull_indexes [ 0 ] : convex_hull_indexes . append ( next_point ) next_point = get_next_point ( points , n_points , convex_hull_indexes [ - 1 ] ) convex_hull_x = [ ] convex_hull_y = [ ] for point in convex_hull_indexes : convex_hull_x . append ( points [ 0 ] [ point ] ) convex_hull_y . append ( points [ 1 ] [ point ] ) return convex_hull_x , convex_hull_y
Returns the convex hull of the given set of point
Returns the convex hull of the given set of point
"""
    Returns the convex hull of the given set of point

    :param points:
    :return: ordered list of the indexes of the point
    """ # Convert the convex hull to coordinates
ordered list of the indexes of the point
ordered list of the indexes of the point
points
None