def map_to_45(x):
    """
    (y-y1)/(x-x1) = (y2-y1)/(x2-x1) ---> x1 = 1, x2 = 5, y1 = 1, y2 = 4.5

    output = output_start + ((output_end - output_start) / (input_end - input_start)) * (input - input_start)

    """

    input_start = 1
    input_end = 5
    output_start = 1
    output_end = 4.5

    if x >= 5:
        return 4.5

    return output_start + ((output_end - output_start) / (input_end - input_start)) * (x - input_start)