def position_to_coord(pos, curve_map):
    """ Gives a coordinate which corresponds to given position.
    :param pos: Position on the curve. Domain [0, 1]
    :type pos: float
    :param curve_map: Generated curve map
    :type curve_map: (list of (int, int), dict of (int, int): int)
    :rtype: (int, int)
    :return:
    """
    curve_length = len(curve_map[0]) - 1
    ipos = round(curve_length * pos)
    try:
        return curve_map[0][ipos]
    except Exception:
        raise Exception('Point is not on the curve!')
