map-clip

xod/math/map-clip

Projects a number from one range to another preserving ratio. Then clips a result to the target range.
map-clip
@/map-clip
Projects a number from one range to another preserving ratio. Then clips a result to the target range.
Xnumber
The value to map and clip.
Sminnumber
Source range lower bound
Smaxnumber
Source range upper bound
Tminnumber
Target range lower bound
Tmaxnumber
Target range upper bound
map-clip
XXSminSminSmaxSmaxTminTminTmaxTmaxOUTOUT
OUTnumber
The resulting mapped and clipped value of `X`.

Previously known as xod/core/map-clip-range.