scale
scale(
@x ## int/float/list (required)
@inmin 0
@inmax 1
@outmin 0
@outmax 1
@slope 0
) -> int/float/list/llll
Scales an input value or list from a given range to another, with optional slope for non-linear scaling.
Arguments
@x[int/float/list]: Value to scale. (required)@inmin[int/float]: Input minimum value. (default:0).@inmax[int/float]: Input maxiumum value. (default:1).@outmin[int/float]: Output minimum value. (default:0).@outmax[int/float]: Output maxiumum value. (default:1).@slope[int/float]: Slope between -1 and 1. 0 means no slope. (default:0).
Output
Scaled input [int/float/list/llll]
Usage
scale(0 1 2 3, 0, 3, 0, 1) ## 0. .33 .66 1.