Simple and dirty JS toy which lets you play with interference patterns.
@tixlegeek - tixlegeek.io - Github - The twitter discussion following the dev: Here
Big thanks to:
- @Jeffwebdesign ( jffraisse ) for the work on the UI and Web Integration!
Copyright (c) 2020 Tixlegeek (MIT, see LICENSE ) - You can do whatever you want with that code.
See online demo Here!
Here's a screen-shot:
This code have been initiated on 05-03-2020. It has been coded in a jiffy. It's pure vanilla JS, without any dependency or hardware magic.
This is not a physics-accurate simulation. The results are approximated following simple statements:
-
Each emitters have parameters that you can set:
- Frequency
- Phase
- Amplitude (power)
All those property are only quantitative.
-
At each point of the graph, the signal is approximated using:
(Sorry, github's Latex renderer is non-existent ) $$ \sum_{E=1}^{nE}sin({Ed_i\times Ef_i - Ep_i})\times \dfrac{1}{Ed_i\times Ea_i} $$ with: $$ Edi = \sqrt{(x_i-Ex_i)^2+(y_i-Ey_i)^2)} $$
These are bad mathematical transcription of the "sum of each emitter's signal amplitude at given point (
$$i$$ )whatever, because, the code is so simple and dirty you could have found out yourself.
In some words: You cannot simulate refraction/diffraction/etc. It's mostly just a toy.
The UI is awful for now, but some people offered to try their magic on this thing. I only needed this for myself, and did not planned to share it, so i did not made any efforts about that.
WEB Integration and UI has been fiddled and enhanced by jffraisse as the original UI was... brutal. I also modified the emitter selection. You can now select like on any other UI.
Here is the old UI for records:
HppHckng!