Question: how x ray diffraction works?
Answer: A crystalline sample is placed in the path of an X-ray beam. X-rays diffract through the crystal and into a detector. The beam and detector are rotated through a range of angles. The angles at which the crystals diffract the beam into the detector correspond to planes of the crystals.