% Nyquist contour
% RMM, 16 Sep 07

aminit;					% initialize settings

figure(1); clf; xsubplot(221);

% Start with a pole/zero diagram for the pole at the origin
ampolezero(tf([1], [1 0]), [-5.25 5.25 -5.25 5.25]);
daspect(daspect);			% square up axes

% Draw lines along the imaginary axis
line([0 0], [-4 -0.5], 'LineWidth', AM_bode_linewidth, 'Color', 'b');
line([0 0], [0.5 4], 'LineWidth', AM_bode_linewidth, 'Color', 'b');

% Draw arcs around origin and at infinity
theta = -pi/2:0.01:pi/2;
plot(0.5*cos(theta), 0.5*sin(theta), 'LineWidth', AM_bode_linewidth);
plot(4*cos(theta), 4*sin(theta), 'LineWidth', AM_bode_linewidth);

% set up the color
color = 'b';
if (AMPRINT_FLAG==2) color = 'k'; end;

% Add an arrow along the arc in the first quadrant
arrow([4*cos(pi/4), 4*sin(pi/4)], [4*cos(pi/4 - 0.01), 4*sin(pi/4 - 0.01)], ...
  AM_normal_arrowsize, 'FaceColor', color, 'EdgeColor', color);

% Add a line to the outer radius
arrow([0 0], [4*cos(-pi/4), 4*sin(-pi/4)], AM_normal_arrowsize, ...
  'FaceColor', 'k', 'LineWidth', AM_ref_linewidth);

% Add text labels
amtext(2, -1.3, 'R');
amtext(0.8, 0.8, 'r');
amtext(3, 3.5, 'Gamma');

amprint('nyqcontour.eps');
