Since every element will have a different diffraction pattern, we can determine the characteristic makeup of the sample by its diffraction angles. Traditional detection of…