% Friday, Nov. 1
% 
% Go over Activity_6-1.pdfd
% 
%PlotChoice = 1; % create transformations and plot axis
%PlotChoice = 2; % plot all n*pi rotations of a single vector 
%PlotChoice = 3; % Plot ellipsoidal rotated vectors
PlotChoice = 4; % Plot points on ellipse 


% create an x-y axis in R^2

	% restrict view window to [-1,1]
	ax = [-1,1,-1,1];
	
	% create Rotation matrix
	CreateTransformations;
	
	% inital (1,0) vector 
	v = [1,0]'
	
	for t = [0:pi/2:2*pi]
			PlotVector(R(t)*v,'-k',ax);
	end

if PlotChoice == 2;
% plot all n*pi rotations of a single vector

	% random vector
	x = rand(2,1);

	for t = [0:pi/5:2*pi]
			PlotVector(R(t)*x,'.r',ax);
	end

elseif PlotChoice > 2;
		close all
		x = rand(2,1)
		A = [.5 .75; -.6 11/10];
		axis(2*ax);
		for i = 1:100;
				if PlotChoice < 4
				h = PlotVector(x,'r',ax);
				else
				PlotAxis
				axis(2*ax);
				h = plot(x(1),x(2),'*k','MarkerSize',10);
				end
				drawnow;
				pause();
				if i < 100; delete(h); end
				x = A*x;
		end

end


	
