wrap static method

double wrap(
  1. double n,
  2. double min,
  3. double max
)

Wraps the given value into the inclusive-exclusive interval between min and max. n The value to wrap.

min The minimum.

max The maximum.

Implementation

/// [n]   The value to wrap.
///
/// [min] The minimum.
///
/// [max] The maximum.
static double wrap(double n, double min, double max) =>
    (n >= min && n < max) ? n : (mod(n - min, max - min) + min);