## How to calculate far field diffractions of specific figures?

Asked by Ege Tunç

### Ege Tunç (view profile)

on 7 Mar 2019
Latest activity Edited by Ege Tunç

### Ege Tunç (view profile)

on 7 Mar 2019
For our single/double slit experiment, TA wanted us to simulate diffractions of figures, like rectange, triangle and most important one is hexagon.
We got a code to modify but we can't get these shapes since the code is written for circular or eliptic shapes. Probably a basic modification inside for loop will be enough. Any ideas?
clc
close all
clear all
%------------------------------------------------------------------------
lambda=500e-9; k=(2*pi)/lambda; % wavelength of light in vaccuum
a=1e-6; % radius of diffracting circular aperture
Io=100.0; % relative intensity
R=1.0e-3; % distance of screen from aperture
Y=(-0.25e-2:1e-5:0.25e-2);
Z=(-0.25e-2:1e-5:0.25e-2);% coordinates of the screen
I(1:length(Y),1:length(Z))=0;
% calculating diffracted intensity
for i=1:length(Y)
for j=1:length(Z)
q=(Y(i).^2+Z(j).^2).^0.5;
beta=k*a*q/R;
I(i,j)=Io.*((besselj(1,beta)/beta).^2);
end
end
%------------------------------------------------------------------------
figure(1)
imshow(I)
title('Fraunhofer Diffraction of circular aperture','fontsize',14)
fh = figure(1);
set(fh, 'color', 'white');