



clear; close;

disp(' This time we combine the motion of the helix r_0(t) ')
disp(' with small rotations parallel to the xy plane. ')
disp(' We take r_1(t) = (.2*cos(20*t), .2*sin(20*t), 0) ')
disp('           t -> r(t) = r_0(t) + r_1(t)  ')
disp('       = (cos(t) + .2*cos(20*t), sin(t) + .2*sin(20*t), t) ')

    x = inline('cos(t) + .2*cos(10*t)');
    y = inline('sin(t) + .2*sin(10*t)');
    z = inline('t');
    t = linspace(0, 2*pi, 101);

    plot3(cos(t), sin(t), t )
    axis([-1.5, 1.5 -1.5 1.5 0 7])
    view(-60,60)
    hold on
    pause
    
    N = moviein(81);
    ss = linspace(0, 2*pi, 81);
    rotate3d on
    for j = 1:81
        s = ss(j);
        tau = linspace(0, s, 101);
        h1 = plot3(x(tau), y(tau),z(tau), 'k');
        h2 = plot3(x(s), y(s),z(s), '*r');
        N(j) = getframe;
        delete(h1); delete(h2);
    end
    pause
    movie(N,1,6)
    rotate3d on
    pause
    close
   

