% ellacc.m  96/07/29
%
% Plot of acceleration vector for r=<2cost,sint>
%
% x^2/4+y^2=1
%

    t=2*pi*(0:50)/50;
    x=2*cos(t); y=sin(t);

    hold off;
    plot(x,y,'w-');  
    hold on;
    axis square;
    axis([-3 3 -3 3]);
    plot([0 0],[-3 3],'w-');
    plot([-3 3],[0 0],'w-');

    t=1;
    p=[2*cos(t); sin(t)]; 
    plot([p(1)],[p(2)],'o');
    der1=[-2*sin(t); cos(t)];
    tanvec=der1/norm(der1);
    norvec=[-cos(t); -2*sin(t)];
    norvec=norvec/norm(norvec);
    der2=[-2*cos(t); -sin(t)];
    c1=der2'*tanvec;
    junk1=p+c1*tanvec;
    c2=der2'*norvec;
    junk2=p+c2*norvec;
%    plot([p(1) junk1(1)],[p(2) junk1(2)],'w--');
%    plot([p(1) junk2(1)],[p(2) junk2(2)],'w--');
%    plot([junk1(1) junk2(1)],[junk1(2) junk2(2)],'w--');

    arrow1(p,p+der2,.2);
    arrow(p,p+tanvec,.2);
    arrow(p,p+norvec,.2);

    xlabel('x');
    ylabel('y');
    text(1.2,.2,'N');
    text(.5,1.4,'T');
    text(.2,.5,'r''''');


    hold off;
