Remap

Moves a number from one range to another, with an optional easing curve.

Parameters

NameTypeDescription
ResultoutputFloatThe input placed in the output range.
InputFloatThe number to remap.
Input RangeVector 2The start and end of the range the input is measured in.
Output RangeVector 2The start and end of the range the result is placed in.
ModeEnumWhat happens with an input outside the input range.Choices: Clamp, Unbounded, Wrap, Mirror
EasingEnumThe curve the result follows from the start of the output range to its end. Ease In starts slow, Ease Out ends slow, and Back and Elastic overshoot the output range for a moment.Choices: Linear, Ease In Sine, Ease Out Sine, Ease In Out Sine, Ease In Quad, Ease Out Quad, Ease In Out Quad, Ease In Cubic, Ease Out Cubic, Ease In Out Cubic, Ease In Expo, Ease Out Expo, Ease In Out Expo, Ease In Back, Ease Out Back, Ease In Out Back, Ease In Elastic, Ease Out Elastic, Ease In Out Elastic, Ease In Bounce, Ease Out Bounce, Ease In Out Bounce

The Remap operator places a number from one range at the same relative position in another. Use it to turn a signal between 0 and 1 into an angle, or the range of a sensor into 0 to 1. Either range may run downwards, so an output range from 1 to 0 flips the input.

In Clamp mode, an input outside the input range holds the result at the nearer end. In Unbounded mode, the result continues past the output range in step with the input, without easing. In Wrap mode, it starts over from the beginning. In Mirror mode, it runs back and forth.

See also Ramp.

Keywords: scale, range, map, normalize, ease, clamp, wrap, mirror, lerp, interpolate