change_range

Remaps one or more value from one range to another.

Returns the result that has the same proportion along the interval between to_start and to_end as the input value has between from_start and from_end.

The clamp option limits values that fall outside of the ranges.

For example:

value:      0.25
from_start: 0
from_end:   1
to_start:   100
to_end:     200

result:     125

Works with float types, vector types, and integer types (though they are converted to floating point types).

Inputs

value

The input value to remap.#

from_start

Lower bound of the source# range.

from_end

Upper bound of the source# range.

to_start

Lower bound of the destin#ation range.

to_end

Upper bound of the destin#ation range.

clamp

If true then out of bou#nd inputs value are clamped. Default is true. #

Output

result

The remapped value.