%
% h = draw_sigma(cov, pos, color)
%
% Display a circle of covariance 'cov' at position 'pos' using
% the color 'color'. For example,
%
% draw_sigma(4, [0 0], 'r');
%
% displays a red circle of radius 2 at (0,0).
%
function h=draw_sigma(cov,pos,color)

points=linspace(0,2*pi,100);   
ell=(sqrt(cov)*[cos(points)' sin(points)']')';
ell(:,1)=ell(:,1)+pos(1);
ell(:,2)=ell(:,2)+pos(2);

h=plot(ell(:,1),ell(:,2), color, 'LineWidth',1.5);
