function []=Shear;
%Shears the letter A to the right, like italics
figure(1);
clf;
% Make up the x,y coordinates of the letter A, or any other figure
x=[0,2,3,5,4.25,3.5,1.4,1.75,3.25,2.5,1.75,1.4,.75,0];
y=[0,3,3,0,0,1,1,1.5,1.5,2.5,1.5,1,0,0];
%plot the letter A and color it red
subplot(221); plot(x,y); fill(x,y,'r');
text(-4,6,'Press a key to continue');
axis([-5 7 -5 7]);
% Shear the letter 30 degrees
t=pi/6;
a=cos(t);
T=[1,a;0,1];   % this is the shearing matrix
M=[x;y];
W=T*M;
pause;
u=W(1,:); v=W(2,:);
% Plot the letter A
subplot(222); plot(u,v); 
title('Shear 30 degrees');
axis([-5 7 -5 7]);
% Shear the letter 150 degrees
t=5*pi/6;
a=cos(t);
T=[1,a;0,1];
M=[x;y];
W=T*M;
pause;
u2=W(1,:); v2=W(2,:);
% Plot the letter A        
subplot(223); plot(u2,v2);
axis([-5 7 -5 7]);
title('Shear 150 degrees');
pause
% Plot the original letter
subplot(224); plot(x,y)
axis([-5 7 -5 7]);

