The Mathematics of Waves
The position of the water surface is calculated for each individual layer $i$ (where $i=0$ is the topmost layer) using the periodic function:
$$y_{i}(x, t) = y_{pos} + A_{i} \sin(k_{i}x + \omega_{i}t + \phi_{i})$$
Each parameter in the equation is derived from your slider settings and scales based on the layer index $i$:
- Amplitude ($A_{i}$): $A_{i} = A_{base} \cdot (1 - C_A \cdot i)$. The Amplitude Reduction ($C_A$) causes background layers to flatten.
- Wave Number ($k_{i}$): $k_{i} = k_{base} \cdot (1 + C_k \cdot i)$. The Frequency Increment ($C_k$) makes background waves more "choppy".
- Angular Frequency ($\omega_{i}$): $\omega_{i} = \omega_{base} \cdot (1 + i \cdot \text{Variance})$. This controls the relative speed between layers.
- Phase Offset ($\phi_{i}$): $\phi_{i} = \phi_{0} + (i \cdot \text{Separation})$. This handles horizontal alignment and the initial shift.
When you enable Superposition, the resultant wave is the algebraic sum of all active layers at every point $x$ along the surface:
$$y_{total}(x, t) = y_{pos} + \sum_{i=0}^{n-1} A_{i} \sin(k_{i}x + \omega_{i}t + \phi_{i})$$