Crystals are regular arrays of atoms, meaning that the atoms are repeated over and over in all three dimensions. X-rays are waves of electromagnetic radiation. When X-rays meet atoms, the electrons in the atoms cause the X-rays to scatter in all directions. Because the X-rays are emitted in all directions, an X-ray striking an electron produces secondary spherical waves emanating from the electron. The electron is known as the "scatterer". A regular array of scatterers (here the repeating pattern of atoms in the crystal) produces a regular array of spherical waves. Although these waves cancel one another out in most directions, they add up in a few specific directions, determined by Bragg's law: