function f(x, y, t) {
let phase1 =
(0.5 +
0.5 *
Math.sin(t / 40 + 0 * Math.PI + 0.5 * Math.sqrt(x ** 2 + y ** 2))) **
2;
let rippleWave = Math.cos(2 * t + 25 * Math.sqrt(0.2 + x ** 2 + y ** 2));
let phase2 =
(0.5 +
0.5 *
Math.sin(t / 40 + 0.75 * Math.PI - 0.5 * Math.sqrt(x ** 2 + y ** 2))) **
2;
let spiralWave =
0 +
(Math.cos(
-2 * t +
18 * Math.sqrt(0.2 + x ** 2 + y ** 2) -
2 * Math.atan((x + 0.001) / y)
) *
(x ** 2 + y ** 2)) /
(x ** 2 + y ** 2 + 0.03) +
1 -
(0.75 * (x ** 2 + y ** 2)) / (x ** 2 + y ** 2 + 0.03);
let phase3 = 1.1 - Math.min(1.1, phase1 + phase2);
let inverseWave = Math.sin(
(25 * (x * y)) / Math.sqrt(1 + x ** 2 + y ** 2) - t
);
return (
0.15 * phase1 * rippleWave +
0.12 * phase2 * spiralWave +
0.15 * phase3 * inverseWave +
0.3
);
}