(hold left-click to tilt; hold right-click to drag; scroll to zoom)
a coherent scattering playground
(hold left-click to tilt; hold right-click to drag; scroll to zoom)
Here you can visualize what happens when a wave (e.g. X-rays) is elastically scattered by point scatterers (e.g. electrons), and how the sum of re-emitted waves creates the Bragg peaks and diffuse scattering measured in diffraction experiments.
Go ahead and click on the arrow button below to go through a short explanation on how to use this applet, or click the close button to go directly to the app.
~ Enjoy! ~
P.S. If you were looking for anime or comics, I totally understand: I love them too! Let me put it this way: this app is a cosplay of a physical phenomenon that allows us to see atoms and molecules and understand how to use them to build new materials, medicines, and much more ;)
In coherent elastic scattering, when an X-ray wave hits an electron, its energy is absorbed and re-emitted as a spherical wave with the same energy (wavelength) and a phase shift of π/2.
The interference of the two waves (incoming and re-emitted) results in a specific pattern visible in the app’s default setting (1).
The Interference options area lets you selectively visualize the source wave (2), the emitted wave (3), or their sum, and switch off the interference of the two.
When more electrons are present (for example in atoms, molecules, and crystals), this occurs for each electron, and the sum of all the waves produces what we measure as coherent elastic scattering.
When the option “Arrangement” is set to Manual (Default), more scatterers can be added by clicking on the plot (1). Changing the option to “Row” adds a row of scatterers, generating diffraction (2): hold the left mouse button on the plot to tilt the sample and observe beams from constructive interference change their orientation. Arrangements such as “Crystal” (3), “Quasicrystal”, and disordered ones are available, each with its own set of options to customize the sample and observe the effect on the scattering pattern.
Many visualization options and interactive functions help the exploration of CosPlay’s behaviour:
•Scrolling with the mouse wheel on the plot area lets you zoom in or out (1); holding the right mouse button lets you drag the sample around. The “Brightness multiplier” slider can be used to see better when intensities get too dim.
•The “Show” field lets you switch from “Field” to “Intensity” (the squared wave amplitude; 2). In this mode, switching on “Time-averaged” stops the animation and makes the scattered intensities easier to see (3).
•Graphical objects on the plot such as the scale bar, source direction, Bragg beam detection, and scatterer visualization can be switched off by unticking the dedicated options (1).
•The wavelength of the incoming beam can also be changed, affecting the angle at which diffraction is observed. In the example below, the default of 1.6 Å is changed to 0.025 Å (2).
•Further options can be
displayed by clicking on the icon, giving access to the wavelength profile and the
Bragg beam detection threshold (used by the graphical option “Bragg
beams”) (3).
CosPlay — a coherent scattering playground
Copyright © 2026 Stefano Canossa
CosPlay is free software: you may use it, study it, pass it on and change it under the GNU General Public License, version 3 or any later version. Anything you build from it must stay free under the same terms.
It is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the licence for the details.
Any use of an image produced by CosPlay must carry an explicit acknowledgement of the software and/or its author.