- weighted(easingNameOrOptions?): number
Parameters
- easingNameOrOptions:
| "bounceOut"
| "quintIn"
| "quintOut"
| "arch"
| "smoothstep"
| "smootherstep"
| "sineIn"
| "sineOut"
| "quadIn"
| "quadOut"
| "sineInOut"
| "quadInOut"
| "cubicIn"
| "cubicOut"
| "quartIn"
| "quartOut"
| "expoIn"
| "expoOut"
| "quintInOut"
| "expoInOut"
| "circIn"
| "circOut"
| "backIn"
| "backOut"
| "circInOut"
| "backInOut"
| "elasticIn"
| "elasticOut"
| "bounceIn"
| "bell"
| "elasticInOut"
| "bounceInOut"
| Readonly<{
easing?:
| "bounceOut"
| "quintIn"
| "quintOut"
| "arch"
| "smoothstep"
| "smootherstep"
| "sineIn"
| "sineOut"
| "quadIn"
| "quadOut"
| "sineInOut"
| "quadInOut"
| "cubicIn"
| "cubicOut"
| "quartIn"
| "quartOut"
| "expoIn"
| "expoOut"
| "quintInOut"
| "expoInOut"
| "circIn"
| "circOut"
| "backIn"
| "backOut"
| "circInOut"
| "backInOut"
| "elasticIn"
| "elasticOut"
| "bounceIn"
| "bell"
| "elasticInOut"
| "bounceInOut";
source?: RandomSource;
}> = ...
Returns number
Random number (0-1)
Returns a random number, 0..1, weighted by a given easing function. Default easing is
quadIn
, which skews towards zero.Use weightedSource to return a function instead.
See
weightedSource Returns a function rather than value