% File: http://web.mit.edu/8.13/matlab/Examples/doubleslit.m % Date: 2008-June-13 % Author: Scott Sewell %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % From Hecht, Optics, Edition 4, Equation 10.24 % doubleslit(b,a,l,f) plots the two slit diffraction pattern for % a slit of width 'b' in mm % a slit separation of 'a' in mm % a wavelength of 'l' in nm % a slit-to-screen distance of 'f' in m. % Produces a plot of intensity versus screen position in mm. % % Recall that the irradiance from a single slit is given by: % I(theta) = I(0)sinc^2(Beta) where Beta = pi b/l % % The effect of the 2nd slit is to modulate this pattern with % the additonal term cos^2(alpha) where alpha is analogous to Beta % but measures the relative lengths of the spacing between the two slits % and the wavelength of light. This of course is effects the standard % interference condition (maxima occur when the differential path % l % Try doubleslit(0.1,0.4,632,.5) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function[x,y]=doubleslit(b,a,l,f) %a=0.4; theta=[-.02:.0001:.02]; beta=pi*(b/1000)/(l/1e9).*sin(theta); alpha=pi*(a/1000)/(l/1e9).*sin(theta); y=4.*(sin(beta).^2./beta.^2).*(cos(alpha).^2); plot(theta*f*1000,y); title('Modelling Two-Slit Diffraction'); xlabel('Screen Position [mm]') ylabel('Intensity');