waveHorRadiusFBack method

double waveHorRadiusFBack(
  1. Size size
)

Implementation

double waveHorRadiusFBack(Size size) {
  if (revealPercent <= 0) {
    return iconSize.width;
  }

  if (revealPercent >= 1) {
    return 0;
  }

  var p1 = 0.4;
  if (revealPercent <= p1) {
    return iconSize.width + revealPercent / p1 * iconSize.width;
  }

  var t = (revealPercent - p1) / (1.0 - p1);
  var A = iconSize.width + 8;
  var r = 40;
  var m = 9.8;
  var beta = r / (2 * m);
  var k = 50;
  var omega0 = k / m;
  var omega = pow(-pow(beta, 2) + pow(omega0, 2), 0.5);

  return A * exp(-beta * t) * cos(omega * t);
}