summaryrefslogtreecommitdiff
path: root/diffracted_image_at_target.m
blob: 90de6573dc76cc38e0e7ccd627731096628c5177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function img_target = diffracted_image_at_target(img_source, xpos_s, ypos_s, image_target, xpos_t, ypos_t, z_t, lambda)

[Ny,Nx]=size(image_target);

xim_t=linspace(xpos_t(1), xpos_t(end), Nx);
yim_t=linspace(ypos_t(1), ypos_t(end), Ny);

img_target=zeros(Ny, Nx);

parfor i=1:Nx
    for k=1:Ny
        field = beam_field_at_point_from_image(xim_t(i), yim_t(k), z_t, img_source, xpos_s, ypos_s, lambda);
        img_target(k,i) = field;
    end
end