function A = makemat(th,l1,l2)

% A = makemat(th,l1,l2)
%
% Given the angle th that one eigenvector makes with x axis 
% and two eigenvalues l1,l2 creat a 2x2 symmetric matrix.

% Create eigenvectors:
u = [cos(th),sin(th)]';
v = [-sin(th),cos(th)]';

% Create diagonal matrix of eigenvalues:
D = diag([l1,l2]);
Q = [u,v];      % orthogonal matrix

% Create symmetric matrix:
A = Q*D*Q';
