% After EigenPlay

% To reverse orientation multiply by J
	J = flipud(eye(2));
	%a = [ 1 3; 4 2]; % Two distinct real eigenvalues
	a = [1 5; 5 1]; % symmetric matrix with orthogonal eigenvectors
%	a = [2 -1;5 1];  % Complex Eigenvalues: shear and rotation
	%a = [1/2 3/4; -3/5 11/10]; % Elliptical Rotation
	%a = 2*eye(2); % Uniform scaling
	%a = [5 0 ; 5 0];
	%a = [0 5; 0 2];
	%a = .2*eye(2); % Uniform scaling
	t = pi/3;
	%a = [cos(t) -sin(t); sin(t) cos(t)]; % Pure rotation
	%a = [cos(t)^2 sin(t)*cos(t); sin(t)*cos(t) sin(t)^2]; % 
	%a = [cos(2*t) sin(2*t); sin(2*t) -cos(2*t)];
	%a = J*a;

EigenPlay

%pause;

D=[X0;Y0]; E=a*D; F=E-D;
quiver(X0,Y0,E(1,:),E(2,:))
[V,L] = eig(a);
VV(:,1) = V(:,1)*max(.75,abs(L(1)));
VV(:,2) = V(:,2)*max(.75,abs(L(4)));
hold on;

if isreal(L)
	% the red eigenvectors
	h = quiver(zeros(1,2),zeros(1,2),VV(1,:),VV(2,:),'r')
	set(h,'LineWidth',5)
	[I,J]=find(L == max(max(L)));
	K = mod(J,2)+1;
	%hl = text(VV(1,J),VV(2,J),'Large EigenValue');
	%hs = text(VV(1,K),VV(2,K),'Small EigenVector');
	%set(hl,'FontSize',25);
	%set(hs,'FontSize',15);
else
	disp('No Real Eigenvalues <-> Rotation');
end
