Function scalerTwoWay

Returns a two-way scaler

// Input range 0..100, output range 0..1
const s = scalerTwoWay(0,100,0,1);

// Scale from input to output
s.out(50); // 0.5

// Scale from output range to input
s.in(1); // 100
  • Parameters

    • inMin: number
    • inMax: number
    • outMin: number = 0
    • outMax: number = 1
    • clamped: boolean = false
    • Optionaleasing: ((v: number) => number)
        • (v): number
        • Parameters

          • v: number

          Returns number

    Returns ScalerTwoWay