algorithms/convex_hull.py
def min_point(points, n_points):
    """
    Return the index of the closest point to (0,0)
    :param points: tuple of list for each coordinate
    :param n_points: number of points
    :return: the index of the selected point in the list
    """
    min_y_indexes = [0]
    min_y = points[1][0]

    # Find minimum y
    for k in range(1, n_points):
        if points[1][k] < min_y:
            min_y_indexes = [k]
        elif points[1][k] == min_y:
            min_y_indexes.append(k)

    # Among the points having the smallest y, find the points having the smallest x
    min_x = points[0][min_y_indexes[0]]
    min_index = min_y_indexes[0]

    for k in min_y_indexes:
        if points[0][k] < min_x:
            min_index = k

    return min_index

    Return the index of the closest point to (0,0)
    :param points: tuple of list for each coordinate
    :param n_points: number of points
    :return: the index of the selected point in the list
    
Return the index of the closest point to (0,0)
Return the index of the closest point to ( 0 0 )
def min_point(points, n_points):
    min_y_indexes = [0]
    min_y = points[1][0]
    for k in range(1, n_points):
        if points[1][k] < min_y:
            min_y_indexes = [k]
        elif points[1][k] == min_y:
            min_y_indexes.append(k)
    min_x = points[0][min_y_indexes[0]]
    min_index = min_y_indexes[0]
    for k in min_y_indexes:
        if points[0][k] < min_x:
            min_index = k
    return min_index
def min_point ( points , n_points ) : min_y_indexes = [ 0 ] min_y = points [ 1 ] [ 0 ] for k in range ( 1 , n_points ) : if points [ 1 ] [ k ] < min_y : min_y_indexes = [ k ] elif points [ 1 ] [ k ] == min_y : min_y_indexes . append ( k ) min_x = points [ 0 ] [ min_y_indexes [ 0 ] ] min_index = min_y_indexes [ 0 ] for k in min_y_indexes : if points [ 0 ] [ k ] < min_x : min_index = k return min_index
Return the index of the closest point to (0,0)
Return the index of the closest point to ( 0 0 )
"""
    Return the index of the closest point to (0,0)
    :param points: tuple of list for each coordinate
    :param n_points: number of points
    :return: the index of the selected point in the list
    """ # Find minimum y # Among the points having the smallest y, find the points having the smallest x
the index of the selected point in the list
the index of the selected point in the list
points
tuple of list for each coordinate
tuple of list for each coordinate
n_points
number of points
number of points