% letters.m displays and alters letters clf; letterF; unitsquare; subplot(3,3,1) plot(US(1,:), US(2,:),'r'); hold on plot(F(1,:), F(2,:)); axis([0 2.5 0 3]); title('The letter F'); subplot(3,3,2) A = [[2 0]; [0 2]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 2.5 0 3]); title('Dilated'); subplot(3,3,3) A = [[2 0]; [0 1]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 2.5 0 3]); title('Stretched in the x direction'); subplot(3,3,4) A = [[2 1]; [0 2]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 3 0 3]); title('Italic F, sheared forward'); subplot(3,3,5) A = [[2 -1]; [0 2]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([-1 2 0 3]); title('Sheared back'); subplot(3,3,6) A = [[0 1]; [1 0]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 2.5 0 3]); title('Reflected across y=x'); subplot(3,3,7) A = [[0.85 0.15]; [0.15 0.85]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 2.5 0 3]); title('Going ... '); text(0.88,0.15, '(1,0) goes to (0.85, 0.15)'); subplot(3,3,8) A = [[0.7 0.3]; [0.3 0.7]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 2.5 0 3]); title('... going ...'); text(0.75,0.3, '(1,0) goes to (0.7, 0.3)'); subplot(3,3,9) A = [[0.5 0.5]; [0.5 0.5]]; G = A*F; H = A*US; plot(H(1,:), H(2,:),'r'); hold on plot(G(1,:), G(2,:)); axis([0 2.5 0 3]); title('... gone!'); text(0.55,0.5, '(1,0) goes to (0.5, 0.5)');