A technique used to determine the atomic and molecular structure of a crystal by measuring the angles and intensities of X-rays diffracted by the crystal.