def compute_closest_coordinate(value, range_min, range_max):
    """
    Function for computing closest coordinate for the neighboring hyperplane.

    Parameters
    ----------
    value : float
        COORDINATE VALUE (x or y) OF THE TARGET POINT.
    range_min : float
        MINIMAL COORDINATE (x or y) OF THE NEGHBORING HYPERPLANE.
    range_max : float
        MAXIMAL COORDINATE (x or y) OF THE NEGHBORING HYPERPLANE..

    Returns
    -------
    v : float
        x or y coordinate.

    """
    
    v = None
 
    if range_min < value < range_max:
        v = value
 
    elif value <= range_min:
        v = range_min
 
    elif value >= range_max:
        v = range_max
 
    return v