function h = plot_ellipse(xc,yc,Q,color)

% h = plot_car(x,y,theta,size)
% plots [x-xc y-yc]*Q*[x-xc y-yc]^T=1 
% (xc,yc): center of ellipse 
% Q: positive definite matrix that define orientation and size of ellipse
% color: color of car
% h:  handle to plot 

% position of triangle vertices

if nargin <4
    color = 'r';
end

N = 50; %number of points of ellipse
theta = linspace(0,2*pi,N);

Ellipse = sqrtm(Q)*[ cos(theta) ; sin(theta)] + [ones(1,N)*xc; ones(1,N)*yc];;

h = plot(Ellipse(1,:),Ellipse(2,:),color);


