def map_to_range(x: int, from_low: int, from_high: int, to_low: int, to_high: int) -> int:
    """
    Re-map a number from one range to another.

    A value of fromLow would get mapped to toLow, a value of fromHigh to toHigh, values in-between to values in-between.

    Do not constrain values to within the range, because out-of-range values are sometimes intended and useful.

    Inspired by https://www.arduino.cc/reference/en/language/functions/math/map/

    :param x: The number to map
    :param from_low: The lower bound of the value’s current range
    :param from_high: The upper bound of the value’s current range
    :param to_low: The lower bound of the value’s target range
    :param to_high: The upper bound of the value’s target range
    :return: The re-mapped value
    :type x: int
    :type from_low: int
    :type from_high: int
    :type to_low: int
    :type to_high: int
    :rtype: int
    """
    return int((x - from_low) * (to_high - to_low) / (from_high - from_low) + to_low)