smootherstep static method

num smootherstep(
  1. num x,
  2. num min,
  3. num max
)

Implementation

static num smootherstep(num x, num min, num max) {
  if (x <= min) return 0;
  if (x >= max) return 1;

  x = (x - min) / (max - min);

  return x * x * x * (x * (x * 6 - 15) + 10);
}