Function randomSource

Source for random bipolar values

const r = Bipolar.randomSource();
r(); // Produce random value on -1...1 scale

Options can be provided, for example

// -0.5 to 0.5 range
Bipolar.randomSource({ max: 0.5 });

Consider using random if you just want a one-off random value.

  • Parameters

    • OptionalmaxOrOptions: number | Readonly<{
          max: number;
          min?: number;
          source?: RandomSource;
      }>

      Maximum value (number) or options for random generation

    Returns RandomSource