def get_point(points, cmp, axis):
    """ Get a point based on values of either x or y axys.

    :cmp: Integer less than or greater than 0, representing respectively
    < and > singhs.
    :returns: the index of the point matching the constraints
    """
    index = 0
    for i in range(len(points)):
        if cmp < 0:
            if points[i][axis] < points[index][axis]:
                index = i
        else:
            if points[i][axis] > points[index][axis]:
                index = i

    return index