def fit_range(x, inmin, inmax, outmin, outmax):
    """Maps a value from an interval to another

    Args:
        x (int or float): the input value
        inmin (int or float): The minimum of the input range
        inmax (int or float): The maximum of the input range
        outmin (int or float): The minimum of the desired range
        outmax (int or float): The maximum of the desired range
    Returns:
        int or float: the computed value
    """
    return (x-inmin) * (outmax-outmin) / (inmax-inmin) + outmin