Interactive three-dimensional simulations & visualizations

Visualizing the beauty in physics and mathematics


Project maintained by zhendrikse Hosted on GitHub Pages — Theme by mattgraham

Young's interference experiment


Dynamic visualization


In this visualization, the interference pattern is generated “dynamically”, i.e. by calculating the propagation of the waves using a finite difference method.

🔧 Original double slit experiment.py by Nelson Hackerman
🔧 Ported to Javascript and three.js by Zeger Hendrikse, see dynamic_double_slit.js
👉 VPython version available as dynamic_double_slit.py, but significantly slower!

  

Static visualization


In this visualization, the interference pattern is generated “statically”, i.e. by calculating the path difference between the beams originating from each source and setting the (pixel) color of the background accordingly.

The two slits are represented by the two cylinders that also now firing particles at the screen/detector in the simulation, so that the difference in the behavior of particles and waves can be clearly seen.

🔧 Original VPython version by Let's code physics
🔧 Refactored and ported to double_slit.js
👉 See also his accompanying video
👉 VPython version available as double_slit.py

0.5

How the interference pattern is generated

The intensity is given by:

\[I = \cos^2\left(\frac{\pi , \Delta r}{\lambda}\right)\]

This is easily translated in code as follows:

this._position.set(x, y, 0);
const r1 = this._position.distanceTo(this._slit1);
const r2 = this._position.distanceTo(this._slit2);
const pathDiff = Math.abs(r1 - r2);
const rAverage = (r1 + r2) * 0.5;
const envelope = 1 / (1 + 0.1 * rAverage);

const brightness = Math.pow(Math.cos(Math.PI * pathDiff / this._wavelength), 2) * envelope;

Background information


In 1801, Thomas Young was the first to perform an experiment that made it unequivocally clear that light is a wave, since the interference pattern he observed was exactly similar to an interference pattern that would have been produced by water waves.

Double slit experiment
Picture illustrating the wave-like nature of light.

Videos on the mystery of the double slit experiment


The following videos are recommended to learn more about the double slit experiment and its repercussions for our view on the reality of nature:

Particle-wave duality


De Broglie relation
Picture illustrating the relation between wavelength and mass.


Share on: