function Jan21()
% Examine what a 2-by-2 matrix does to the set of unit vectors.
% Our example...
A = [ 1 4; 3 -2];
% The number of unit vectors participating in the display...
N = 40;

% Question (a) is concerned with x-vectors with unit 2-norm.
% This means sqrt( x(1)^2 + x(2)^2 ) = 1;
% Let's construct a 2-by-N matrix whose columns are unit vectors...
theta = linspace(0,2*pi,N);
xVecs = [cos(theta);sin(theta)];
% The k-th column of this matrix is [cos(theta(k));sin(theta(k))].
% We want to apply A to each of these vectors...
yVecs = A*xVecs;
% This means that yVecs(:,k) = A*xVecs(:,k), k=1:N.
% Now let's display each matrix-vector product...
close all
figure
set(gcf,'position',[100 100 850 520])
subplot(1,2,1)
% This plot window will display the x-vectors.
% Set up the axes and the unit circle...
hold on
plot([0 0],[-1.5 1.5],':r',[-1.5 1.5],[0 0],':r')
xCircle = cos(linspace(0,2*pi,200));
yCircle = sin(linspace(0,2*pi,200));
plot(xCircle,yCircle,'k')
axis equal square
title('Domain','fontsize',18)

subplot(1,2,2)
% This plot window will display the y-vectos
plot([0 0],[-5 5],':r',[-5 5],[0 0],':r')
axis equal square
title('Range','fontsize',18)
hold on
shg
hold on
pause
for k=1:N
    subplot(1,2,1)
    plot(xVecs(1,k),xVecs(2,k),'.k','Markersize',20);
    subplot(1,2,2)
    plot(yVecs(1,k),yVecs(2,k),'.m','Markersize',20);
    pause(.2)
end

    