Skip to content

๐Ÿˆ Double slit experiment

JavaScriptThree.js

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.

๐ŸŽฏ Visualization of a real (discrete scalar) field
๐Ÿง  Inspired by original VPython version by Letโ€™s code physics
๐Ÿ‘‰ See also his accompanying video
๐Ÿ A 3D VPython demo is available as well, see double_slit.py

Source

The intensity is given by:

I=cosโก2(ฯ€ฮ”rฮป)I = \cos^2\left(\frac{\pi \Delta r}{\lambda}\right)

This is easily translated in code as follows:

const pos = new Vec3(x, y, 0);
const r1 = pos.distanceTo(posSlit1);
const r2 = pos.distanceTo(posSlit2);
const pathDiff = Math.abs(r1 - r2);
const rAverage = (r1 + r2) * 0.5;
const envelope = 1 / (1 + 0.1 * rAverage);
field.setValueAt(i, j, Math.pow(Math.cos(Math.PI * pathDiff / wavelength), 2) * envelope);

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.

Wave-particle duality
Picture illustrating the wave-like nature of light.


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


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