%  Demonstration of spatial impulse response for a
%  rectangular aperture using Field II
%
%  Version 1, July 3, 1999, Joergen Arendt Jensen
%
%  Find time position and plot the corresponding projected circle

%  Delete the previous circle

axes(explanation)
hold on
plot(rt*cos(theta)+x,rt*sin(theta),'w','LineWidth',2)
hold off

%  Get the position

axes(sir)
hold on
plot([tt tt],[0 1600],'w','LineWidth',2)
[tt,dummy]=ginput(1);
plot([tt tt],[0 1600],'g','LineWidth',2')
hold off

%  Plot the corresponding circle

rt=abs(sqrt((tt/1e6*c).^2-(z/1000)^2)*1000);
theta=(0:360)/180*pi;

%  Plot the circle

axes(explanation)
hold on
plot(rt*cos(theta)+x,rt*sin(theta),'g','LineWidth',2)
hold off
