def _transform_interval(
        interval, first_domain_start, first_domain_end, second_domain_start, second_domain_end
):
    """
    Transform an interval from one domain to another.
    The interval should be within the first domain [first_domain_start, first_domain_end]
    For example, _transform_interval((3, 5), 0, 10, 100, 200) would return (130, 150)
    """
    def transform_value(value):
        position = (value - first_domain_start) / (first_domain_end - first_domain_start)
        return position * (second_domain_end - second_domain_start) + second_domain_start

    return [transform_value(value) for value in interval]