function animate_helicopter(sol)

[m,n] = size(sol);
figure99 = figure;
wmin = min(min(sol(:,1)),min(sol(:,2)));
wmax = max(max(sol(:,1)),max(sol(:,2)));
wmin = wmin - (wmax-wmin)*0.05;
wmax = wmax + (wmax-wmin)*0.05;
for i = 1:m
    clf
    axes1 = axes('Parent',figure99,'FontSize',16);
    plot(sol(1:i,1),sol(1:i,2))
    xlim([wmin wmax]);
    ylim([wmin wmax]);
    axis square
    hold on
    plothelicopter(sol(i,1),sol(i,2))
    pause(0.05);
end

function plothelicopter(x0,y0)
x = [-1,-1];
y = [0,3];
x = x + x0;
y = y + y0;
plot(x,y,'LineWidth',2,'Color',[0,0,0])
hold on
x = [-6,4];
y = [3,3];
x = x + x0;
y = y + y0;
plot(x,y,'LineWidth',2,'Color',[0,0,0])

t = (1/16:1/8:1)'*2*pi;
x = x0+2*sin(t);
y = y0+2*cos(t);
x(6) = x(6)-5;
x(7) = x(7)-5;
y(6) = y(6)+1.5;
y(7) = y(7) + 1.0;
fill(x,y,'r')


end

end
