%% Example Of A Locally Conformal Mapping: w = z^2, z ≠ 0 %% CSUMS Summer 2010 A.O. Hausknecht %% Written using OCTAVE function plotZSqr_CircularGrid() clf; %% Create A Plot Of The Circular Grid subplot (1, 2, 1) title ("Grid Of Truncated Sectors") hold on %% Fill a truncated sector %% 1. Generate points along the bottom edge %% which is part of a circle. t = linspace(pi/4,3*pi/8, 10); x1 = 3*cos(t); y1 = 3*sin(t); %% %% 2. Generate points along the top edge %% in revese order. %% %% Reverese the order of the t-values. t = fliplr (t); %% and generate the points x2 = 4*cos(t); y2 = 4*sin(t); %% %% 3. Now collect all the points of the regions %% boundary together in counter-clockwise order! x = cat(2, x1, x2); y = cat(2, y1,y2); %% %% 4. Finally, fill the region with gray fill (x, y, [0.9 0.9 0.9]) %% Plot the grid's circles t = linspace(0,2*pi, 50); for r = 1:4 plot( r*cos(t), r*sin(t),'b'); end %% Plot the grid's radial lines r = 0:.1:4; for theta = 0: pi/8.0: 2*pi plot( r*cos(theta), r*sin(theta), 'r') end axis('equal'); axis([-5 5 -5 5]) %% Draw Unit Tangent vectors at z = (3+3i)/sqrt(2) %% 1. Draw the tangent <-1, 1>/sqrt(2) to the circle at z z = (3+3*i)/sqrt(2); dz = (-1+i)/sqrt(2); a = [real(z) real(z + dz)]; b = [imag(z) imag(z + dz)]; line(a, b, 'linewidth',3, 'color', 'blue') %% %% 2. Draw the radial tangent <1, 1>/sqrt(2) to at z. dz = (1+i)/sqrt(2); a = [real(z) real(z + dz)]; b = [imag(z) imag(z + dz)]; line(a,b, 'linewidth',3, 'color', 'red') hold off %% Create A Plot The Image Of The Circular Grid subplot (1, 2, 2) title ("Image Of Grid Under z^2") hold on %% Fill the image of truncated sector %% 1. Generate points along the bottom edge which is part of a circle. t = linspace(pi/2,3*pi/4, 20); x1 = 9*cos(t); y1 = 9*sin(t); %% %% 2. Generate points along the top edge in revese order. %% %% Reverese the order of the t-values. t = fliplr (t); x2 = 16*cos(t); y2 = 16*sin(t); %% %% 3. Now collect all the points of the regions %% boundary together in counter-clockwise order! x = cat(2, x1, x2); y = cat(2, y1,y2); %% %% 4. Finally, fill the region with gray fill (x, y, [0.9 0.9 0.9]) %% Plot images of the circles under w = z^2 t = linspace(0,2*pi, 50); for r = 1:4 plot(r*r*cos(t), r*r*sin(t),'b'); end %% Plot images of the radial lines under w = z^2 rSqr = 0: .1: 16; for theta = 0: pi/4.0: 2*pi plot(rSqr*cos(theta), rSqr*sin(theta), 'r') end axis('equal') %% Plot images of the Unit Tangent vectors at [ (3+3i)/sqrt(2)]^2 z = (3+3i)/sqrt(2); w = z^2; %% 1. Use the derivative to plot the image of the tangent perpindicular %% to the circle: Note: dw = 2z*dz dz = (-1+i)/sqrt(2); dw = 2*z*dz; a1 = real(w); b1 = imag(w); a2 = real(w+dw); b2 = imag(w+dw); a = [a1 a2]; b = [b1 b2]; line(a,b, 'linewidth', 3, 'color', 'blue') %% %% 2. Use the derivative to plot the image of the radial tangent %% to the circle: Note: dw = 2z*dz dz = (1+i)/sqrt(2); dw = 2*z*dz; a2 = real(w+dw); b2 = imag(w+dw); a = [a1 a2]; b = [b1 b2]; line(a,b, 'linewidth', 3, 'color', 'red') hold off