Skip to content
Snippets Groups Projects
Commit 5e73c8b9 authored by frey.balazs96's avatar frey.balazs96 :eggplant:
Browse files

FarField javítások

parent beb56ecc
Branches
No related tags found
No related merge requests found
...@@ -7,17 +7,20 @@ classdef FarField ...@@ -7,17 +7,20 @@ classdef FarField
methods (Static) methods (Static)
function field = CalculateFarField(ntheta, nfi, apertureSize, wavelength, histogram) function field = CalculateFarField(ntheta, nfi, apertureSize, wavelength, histogram)
field = zeros(1, ntheta); field = zeros(1, ntheta);
theta = linspace(-pi/6, pi/6, ntheta); theta = linspace(-pi/18, pi/18, ntheta);
fi = linspace(0, 2*pi, nfi); fi = linspace(0, 2*pi, nfi);
nr = floor(length(histogram)/2); nr = floor(length(histogram)/2);
r = linspace(0, apertureSize/2, nr); r = linspace(0, apertureSize/2, nr);
c1 = (apertureSize/(2*nr))*2*pi/nfi;
c2 = 1i*2*pi/wavelength;
for i = 1:ntheta for i = 1:ntheta
er = [cos(theta(i)) sin(theta(i)) 0]; er = [cos(theta(i)) sin(theta(i)) 0];
for j = 1:nr for j = 1:nr
area = r(j) * c1;
ind = 2*nr-j+1;
for k = 1:nfi for k = 1:nfi
rv = [0 r(j)*sin(fi(k)) r(j)*cos(fi(k))]; rv = [0 r(j)*sin(fi(k)) r(j)*cos(fi(k))];
area = (apertureSize/(2*nr)) * r(j)*2*pi/nfi; field(i) = field(i) + histogram(ind)*exp(c2*rv*er')*area;
field(i) = field(i) + histogram(2*nr-j+1)*exp(1i*2*pi*rv*er'/wavelength)*area;
end end
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment