clf
set(0,'defaulttextinterpreter','latex')
 
F1=@(x,y) exp(x).*cos(y); F2=@(x,y) -exp(x).*sin(y);
x=linspace(0,4,20);y=linspace(-2,2,21);
[X,Y]=meshgrid(x,y);
quiver(X,Y,F1(X,Y),F2(X,Y),1.5,'LineWidth',1.2)
hold on
axis([.5,5.5,-2.5,2.5])
axis equal
%set(gca,'YTickLabel',{})
% set(gca,'XTickLabel',{}) 
% set(gca,'ZTickLabel',{})
 text(0,2.2,'$\mathbf{F}(x,y) = e^x\cos y \mathbf{i} -e^x\sin y\mathbf{j}$','FontSize',14)

pause
t=linspace(0,2*pi,100);
for n=1:99
    ts=linspace(t(n),t(n+1),2)
    x=2.3+1.5*cos(ts);
    y=-0.5+1.2*sin(ts);
    plot(x,y)
    i=@(t) -1.5*F1(2.3+1.5*cos(t),-0.5+1.2*sin(t)).*sin(t)+1.2*F2(2.3+1.5*cos(t),-0.5+1.2*sin(t)).*cos(t)
    arb=quad(i, 0, t(n+1));
    tex=text(0,-2.3,['$Arbetet=\int_{\mathcal{C}}{\bf F\cdot dr}=$' num2str(arb)],'FontSize',14)
    pause
    if n<99
        delete(tex)
    end
end