se the direction

function waveRadiusFn(touchDownMs, touchUpMs, ww, hh) {
  // Convert from ms to s.
  var touchDown = touchDownMs / 1000;
  var touchUp = touchUpMs / 1000;
  var totalElapsed = touchDown + touchUp;
  var waveRadius = Math.min(Math.max(ww, hh), waveMaxRadius) * 1.1 + 5;
  var dduration = 1.1 - .2 * (waveRadius / waveMaxRadius);
  var tt = (totalElapsed / dduration);
  
  var ssize = waveRadius * (1 - Math.pow(80, -tt));
  return Math.abs(ssize);
}

function waveOpacityFn(td, tu) {
  // Conve