/Optics-Simulation

This application is built for simulating and demonstrating simple light behaviours: reflection, refraction in mediums of different shapes and refractive indices, including circles and polygons, lens behaviours and light filters

Primary LanguageJavaScript

Optics Simulation

This application is built for simulating and demonstrating simple light behaviours: reflection, refraction in mediums of different shapes and refractive indices, including circles and polygons, lens behaviours and light filters

This application is in no way optimized or intended for smartphones and tablets

View it live

This project uses p5.js, a canvas library. It was after this project that I built my own improved (for me) canvas library for JavaScript that does away with the global and non-modular nature of p5, while still remaining equally easy to use. Check out needless

I have tried to use as efficient math algorithms as possible for all calculations, and you will find that the application runs smoothly until, ofcourse, you put two mirrors next to each other and boom, you have The Infinite Reflection. I know you want to go try that now.

I intend to include here explanations of some of the algorithms, but that requires time sigh