@blinkk/degu
    Preparing search index...

    Function getProgressInRangeByValue

    • Normalizes a given range (min and max) to a progress (a value between 0 and 1) For instance, let's say you have a range of 325-1450. You want 0% = 325 and 100% = 1450. You can pass a value 420 and this will return the progress (percentage).


      mathf.getProgressInRangeByValue(2, 0, 10) // 0.2
      mathf.getProgressInRangeByValue(10, 0, 10) // 1
      mathf.getProgressInRangeByValue(7, 2, 12) // 0.5

      Parameters

      • val: number
      • min: number

        The low end of the range.

      • max: number

        The high end of the range.

      Returns number

      The progress within the range.