% Modified from Prof. Womersley's geom.m % MATH1251: File = geom2.m % Plot regions in complex plane format compact w = -3 + 4i r = 5 npts = 400; t = (2*pi/npts)*[0:npts]; z = w + r*(cos(t)+i*sin(t)); x = real(z); y = imag(z); xlim = [floor(min(x))-1 ceil(max(x))+1] ylim = [floor(min(y))-1 ceil(max(y))+1] figure(1) subplot(3,2,1) plot(z, 'b') hold on plot(w, 'b*'); hold off grid on title(['|z +3-4i| = ' num2str(r)]); xlabel('Re(z)') ylabel('Im(z)') set(gca, 'XLim', xlim) set(gca, 'YLim', ylim) axis square subplot(3,2,2) plot(z, 'b') hold on fill(x, y, 'c') plot(w, 'b*'); hold off grid on title(['|z +3-4i| \leq ' num2str(r)]); xlabel('Re(z)') ylabel('Im(z)') set(gca, 'XLim', xlim) set(gca, 'YLim', ylim) axis square subplot(3,2,3) plot(z, 'b--') hold on fill([x xlim(2) xlim(1) xlim(1) xlim(2) xlim(2)], ... [y ylim(1) ylim(1) ylim(2) ylim(2) ylim(1)], 'c', 'EdgeColor', 'None') plot(w, 'b*'); hold off grid on title(['|z - ' num2str(w) '| > ' num2str(r)]); xlabel('Re(z)') ylabel('Im(z)') set(gca, 'XLim', xlim) set(gca, 'YLim', ylim) axis square subplot(3,2,4) a = -4; I = find(x>=a); J = find(abs(x-a)<1e-1); plot(z, 'b') hold on plot([a a], ylim, 'b'); fill(x(I), y(I), 'c') plot(w, 'b*'); hold off grid on title(['|z - ' num2str(w) '| \leq ' num2str(r) ' and Re(z) \geq -4']); xlabel('Re(z)') ylabel('Im(z)') set(gca, 'XLim', xlim) set(gca, 'YLim', ylim) axis square t1 = (pi/800)*[0:200]; z1 = w + r*(cos(t1)+i*sin(t1)); x1 = [real(w) real(z1)]; y1 = [imag(w) imag(z1)]; subplot(3,2,5) plot(z, 'b') hold on fill(x1, y1, 'c') plot(w, 'b*'); hold off grid on title(['|z +3 -4i| \leq ' num2str(r) ' and 0 \leq Arg(z+3-4i) \leq \pi/4']); xlabel('Re(z)') ylabel('Im(z)') set(gca, 'XLim', xlim) set(gca, 'YLim', ylim) axis square