
nframes=200;
ts=0;
tend=4*pi;

t=linspace(ts,tend,nframes);
xx=8.*cos(t); yy=8.*sin(t);zz=t;

mlength=length(getframe);

melps=moviein(nframes);

in=1;
for i=1:nframes;
    tt=linspace(ts,t(i),i);
    x=8.*cos(tt); y=8.*sin(tt);z=tt;
    plot3(xx,yy,zz,'-');hold on;
    plot3(x,y,z,'r-'); hold on;
    plot3(x(i),y(i),z(i),'ro');
    
box on;
grid on;
axis equal;
view([10 10 5]);

title('f(t)=8cos(t) {\bf i} + 8sin(t) {\bf j} + t {\bf k}, t \in [0, 4\pi]')
xlabel('x');
ylabel('y');
zlabel('z');

tt=ts+i*(tend-ts)/nframes;
tt=tt/pi;
 tname=['t=' num2str(tt) 'pi'];
 text(x(i),y(i),z(i),tname);
 melps(i)=getframe;
 in=in+1;
%clf('reset');
hold off;
end;
 
% for n=1:nframes;
% [xe,map1]=frame2im(melps(:,n));
% fname=['' num2str(n) 'cc3d1.jpg'];
% imwrite(xe,fname, 'jpeg');
% end;
%np=1;
%fps=10;

%movie(melps,np,fps);
