Skip to content

Simple and dirty JS toy which lets you play with interference patterns.

License

Notifications You must be signed in to change notification settings

tixlegeek/interferencePatternJsToy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

interferencePatternJsToy

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:

Copyright (c) 2020 Tixlegeek (MIT, see LICENSE ) - You can do whatever you want with that code.


See online demo Here!

tree emitter interference

four emitter interference

two emitters interference

drawing null pattern

Here's a screen-shot:

screenshot

About the code

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.

About Physics accuracy

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.

About the UI

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:

image-20200306133658929

HppHckng!

About

Simple and dirty JS toy which lets you play with interference patterns.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published