diff --git a/RTX class/BalazsAperture.m b/RTX class/BalazsAperture.m index 3384ce13a131aad58cceb00e55ce0d3a8e1153ea..4499a12b301e249790e90b2f3abd2fae973bca7f 100644 --- a/RTX class/BalazsAperture.m +++ b/RTX class/BalazsAperture.m @@ -29,13 +29,23 @@ classdef BalazsAperture < Aperture histogram = obj.getCollisionHistogram(); figure; x = linspace(-obj.size/2, obj.size/2, length(histogram)); + subplot(2,1,1); - plot(x, abs(histogram)); - subplot(2,1,2); - plot(x, angle(histogram)); - title("Apertúrán áthaladó sugarak eloszlása"); - xlabel("Pozíció"); + stem(x, abs(histogram),'MarkerSize',0.001); + title("Apertúrán áthaladó sugarak száma"); + xlabel("r'"); ylabel("Sugarak száma"); + xlim([-obj.size/2, obj.size/2]); + + subplot(2,1,2); + stem(x, angle(histogram),'MarkerSize',0.001); + title("Apertúra megvilágításfüggvénye - fázis"); + xlabel("r'"); + xlim([-obj.size/2, obj.size/2]); + ylim([-pi, pi]); + yticks([-pi, -3*pi/4, -pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi]); + yticklabels({'-\pi', '', '-^{1}/_{2}\pi', '',... + '0', '', '^{1}/_{2}\pi', '', '\pi'}); end end end diff --git a/RTX class/SegmentedAperture.m b/RTX class/SegmentedAperture.m index c17dde1206db84ac2ef50919fb456c7e4aa3abcc..2ce94b37e3b852d1c8799f4113eee0657dea303c 100644 --- a/RTX class/SegmentedAperture.m +++ b/RTX class/SegmentedAperture.m @@ -35,19 +35,29 @@ classdef SegmentedAperture < Aperture function plotApertureField(obj) figure; [histogram,x1, x2] = obj.getCollisionHistogram(); - plot(0, 0); - hold on; -% for k = 1:length(histogram) -% plot([x1(k) x2(k)], [abs(histogram(k)), abs(histogram(k))],'b'); -% end x = [x1; x2]; h = [histogram; histogram]; + subplot(2,1,1); - plot(x(:), abs(h(:))); + plot(x(:), abs(h(:)), 'LineWidth', 1.5); + title("Apertúra megvilágítsáfüggvénye - amplitúdó"); + xlabel("r'"); + ylabel("|E(r')|"); + xlim([-obj.size/2, obj.size/2]); + + subplot(2,1,2); - plot(x(:), angle(h(:))); - %plot(x(:), h(:), 'b'); - hold off; + plot(x(:), angle(h(:)), 'LineWidth', 1.5); + title("Apertúra megvilágítsáfüggvénye - fázis"); + xlabel("r'"); + ylabel("argE(r') [rad]"); + xlim([-obj.size/2, obj.size/2]); + ylim([-pi, pi]); + yticks([-pi, -3*pi/4, -pi/2, -pi/4, 0, pi/4, pi/2, 3*pi/4, pi]); + yticklabels({'-\pi', '', '-^{1}/_{2}\pi', '',... + '0', '', '^{1}/_{2}\pi', '', '\pi'}); + + end end end