An X-ray photon typically has a kinetic energy of about 1000 eV and a probability wavelength of about 10-10 m, roughly the typical size of an atom. Thus X-rays diffract strongly from individual atoms or molecules, or individual layers of atoms in solids. Diffraction of X-ray photons (or electrons) from crystals or individual molecules produces a pattern which can be mathematically inverse-transformed to show the electron density distribution from which the particles scattered. Using computer programs that calculate the electron density, based on given atomic arrangements, it is possible to obtain very detailed information about precisely how atoms are fitted together in extremely complex crystals or molecules.