easeInOutElastic static method

double easeInOutElastic(
  1. double t
)

Elastic easing in/out.

Implementation

static double easeInOutElastic(double t) {
  if (t == 0.0) return 0.0;
  if (t == 1.0) return 1.0;
  const c5 = (2.0 * math.pi) / 4.5;
  return t < 0.5
      ? -(math.pow(2.0, 20.0 * t - 10.0) *
                math.sin((20.0 * t - 11.125) * c5)) /
            2.0
      : (math.pow(2.0, -20.0 * t + 10.0) *
                    math.sin((20.0 * t - 11.125) * c5)) /
                2.0 +
            1.0;
}