REMAP
A value moved from one range to another: as far from c towards d as the value is from a towards b.
Syntax
REMAP(a,b,c,d,value)
| Argument | Meaning |
|---|---|
| a, b | The range the value is in: two numbers (or positions). |
| c, d | The range to move it to: two numbers, or two positions. |
| value | The value, in the first range (or beyond it). |
Result
A number, or a position when c and d are positions.
Examples
In the example drawing:
| Expression | Gives |
|---|---|
REMAP(0,10,100,200,4) |
140 |
REMAP(0,1,0,360,1/8) |
45 |
REMAP(0,10,P0,P1,5) |
[250,0] |
REMAP(0,1',0,100,3") |
25 |
Notes
The same as LERP(c,d,INVERSELERP(a,b,value)). It isn't held within the ranges: a value beyond a or b gives one beyond c or d (use CLAMP first to hold it). a and b must differ.
See also: INVERSELERP, LERP.