Jitters value by the absolute jitter amount. Returns a function.
All values should be on a 0..1 scale, and the return value is by default clamped to 0..1.
Pass clamped:false as an option to allow for arbitary ranges.
jitter returns a function that calculates jitter. If you only need a one-off
jitter, you can immediately execute the returned function:
Jitters
value
by the absolutejitter
amount. Returns a function.All values should be on a 0..1 scale, and the return value is by default clamped to 0..1. Pass
clamped:false
as an option to allow for arbitary ranges.jitter
returns a function that calculates jitter. If you only need a one-off jitter, you can immediately execute the returned function:However, if the returned jitter function is to be used again, assign it to a variable:
A custom source for random numbers can be provided. Eg, use a weighted random number generator:
Options
value
s out of percentage range can be used and return value may be beyond percentage range. True by default