X-ray crystallography uses x-ray diffraction patterns to determine the atomic structure of crystals. X-rays are produced using an x-ray tube and passed through a monochromator to produce a single wavelength. The x-rays are then directed at a crystal sample, which causes the beams to diffract into specific directions based on the crystal structure. Detectors measure the intensities and angles of the diffracted beams, which are used to reconstruct the three-dimensional electron density and atomic positions in the crystal. X-ray crystallography has applications in determining crystal structures, polymer characterization, and analyzing materials.