smooth function

double smooth(
  1. double t, {
  2. double? inflection,
  3. double? pauseRatio,
})

Implementation

double smooth(double t, {double? inflection, double? pauseRatio}) {
  inflection ??= 10.0;

  var error = sigmoid(-inflection / 2);

  return clip(
      (sigmoid(inflection * (t - 0.5)) - error) / (1 - 2 * error), 0, 1);
}