If a beam of X-rays hits a sample, the beam is diffracted into many directions. This diffraction is recorded with a detector and results in a diffraction pattern. From the diffraction pattern, properties of the sample can be calculated using special software. This method can be used for determining the arrangement and properties of atoms in molecules.