y = touchDown * 0.3;
  var waveOpacity = waveOpacityFn(td, tu);
  return Math.max(0, Math.min(outerOpacity, waveOpacity));
  
}

function waveGravityToCenterPercentageFn(td, tu, r) {
  // Convert from ms to s.
  var touchDown = td / 1000;
  var touchUp = tu / 1000;
  var totalElapsed = touchDown + touchUp;

  return Math.min(1.0, touchUp * 6);
}


// Determines whether the wave should be completely removed.
function waveDidFinish(wave, radius) {
  var waveOpacity = waveOpacityFn(wave.tDown, wave.tUp);
  // 