function animate_trebuchet(times,sols,alpha,L,d)
figure('Color',[1 1 1])
x = [];
y = [];
for i = 1:length(times)
   t = times(i);
   r = [L*cos(-pi/3+alpha*t^2/2),L*sin(-pi/3+alpha*t^2/2)];
   xbar = [-r(1)/10,r(1)];
   ybar = [-r(2)/10,r(2)];
   clf
   plot(xbar,ybar,'LineWidth',4,'Color',[0,0,0]);
   xlim([-1.5*L 2.5*L])
   ylim([-2.*L 2.*L])
   axis off
   axis square
   hold on
   xsling = [r(1),r(1) + d*sin(sols(i,1))];
   ysling = [r(2),r(2) - d*cos(sols(i,1))];
   plot(xsling,ysling,'LineWidth',2,'Color',[0,1,0])
   plot(xsling(2),ysling(2),'ro','MarkerSize',11,'MarkerFaceColor',[1,0,0])
   x = [x,xsling(2)];
   y = [y,ysling(2)];
   plot(x,y,'Color',[0.5,0.5,0],'LineStyle','--');
   pause(0.05)  
end

end