 Math.min(1, radius / wave.containerSize * 2 / Math.sqrt(2) );

        x += translateFraction * (wave.endPosition.x - wave.startPosition.x);
        y += translateFraction * (wave.endPosition.y - wave.startPosition.y);
      }

      // If we do a background fill fade too, work out the correct color.
      var bgFillColor = null;
      if (scope.backgroundFill) {
        var bgFillAlpha = waveOuterOpacityFn(tDown, tUp);
        bgFillColor = cssColorWithAlpha(wave.waveColor, bgFillAlpha);
      }

      //