Initialize: 2*d sin(cta)= lambda;
You can adjust d,cta and lambda (wavelength)
And you will find the outgoing waves only in phase at particular angle which satisfy
2*d sin(cta)= n*lambda Bragg diffraction occurs when radiation, with a wavelength comparable to atomic spacings, is scattered in a specular fashion by the atoms of a crystalline system, and undergoes constructive interference Bragg's law, which describes the condition on θ for the constructive interference to be at its strongest: 2*d*sinθ = n λ where n is a positive integer and λ is the wavelength of the incident wave