Skip to content

cveto/EMWaves

Repository files navigation

EMWaves

Simple Electromagnetic Wave Simulator - animated

Demo: https://htmlpreview.github.io/?https://github.com/cveto/EMWaves/blob/master/simulacija_svetlobe.html

This is a one-file-only HTML/Javascript(pure)/CSS simulator of light. It is capable of simulating some simple wave propeties and calculate basic parameters.

First version still requires heavy testing beacuse Javascript has some floating-poing strangeness and tends to mess up calculations entierly.

It's purpose was for me to try visualizing negative group velocity and since I no longer have access to Matlab, I built my own. My goal is to create realistic and intuitive portable and simple animations, which is the reason why all code is packed in to one file.

Works best in Opera and Chrome and new chromium based E, has some performacne issues with Mozilla.

Code not optimizied for performance as it is a hobby project. Floating points "wirdness", timer overflow, rounding errors (for simulation, for sinal calculation it should be exact to the decimal place presented) not adressed.

The pause stop stops the signal, but it does not stop the simulation. Reducing speed will not make it easier for the PC, reducing sample size however - will.

  • coded in Notepad++
  • translation following as soon as calculation error-checking is complete.

Screenshot2

Screenshot1

Screenshot3

Screenshot4

About

Trying to visuailize EM waves

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages