Interactive 2-D wave simulator built in HTML, CSS, and JavaScript. Users can create, edit, and animate wave sources, adjust medium properties, and observe interference patterns in real time.
-
Realistic Physics toggle
- Switch between exponential decay with user-controlled damping and geometric decay for physically accurate 2-D spreading.
-
Medium Properties panel
- Animation speed, damping (hidden in realistic mode), resolution, and color mode controls.
-
Pattern Generator panel
- Tools to create preset or custom source patterns.
-
Edit Points panel
- Add, move, or delete individual wave sources.
-
Floating toggle buttons
- Grid and Points visibility controls with active/inactive color states, always visible above the Clear and Sync buttons.
-
Responsive UI
- Panels and floating controls adapt to desktop and mobile layouts.
-
Open
index.htmlin a modern browser. -
Use floating buttons to show or hide the grid or source points.
-
Navigate through the three panels to:
- Adjust medium parameters and enable Realistic Physics.
- Generate wave patterns.
- Edit source points manually.
-
Clear or sync the simulation at any time using the floating utility buttons.
- Wave computation is handled in
WaveEngine, which calculates pixel values using either exponential or geometric decay. - UI state is managed by
UIController, which updates engine parameters and handles floating button states. - No external dependencies; runs entirely client-side.
Tested on recent versions of Chrome, Firefox, Edge, and Safari.
MIT License – see LICENSE for details.
Fork the repository and submit pull requests with clear descriptions of changes.