@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function mapRange

    • Map a value from one range to another

      将一个值从一个范围映射到另一个范围

      Parameters

      • value: number

        The value to map. 要映射的值

      • inMin: number

        The minimum of the input range. 输入范围的最小值

      • inMax: number

        The maximum of the input range. 输入范围的最大值

      • outMin: number

        The minimum of the output range. 输出范围的最小值

      • outMax: number

        The maximum of the output range. 输出范围的最大值

      Returns number

      The mapped value. 映射后的值

      mapRange(5, 0, 10, 0, 100) // => 50
      mapRange(0, 0, 10, 0, 100) // => 0
      mapRange(10, 0, 10, 0, 100) // => 100