Function randomJitter

  • Create a random jitter generator function.


    • r: number

      Jitter factor around 1.

    • x: number = 1

      Median value.

    Returns (() => number)

    Jitter generator function.

      • (): number
      • Returns number

    Each time the returned jitter generator function is called, it returns a number within [x*(1-r), x*(1+r)] range. For example, randomJitter(0.1, 2) creates a jitter generator function that returns random values within [1.8, 2.2] range.