
nframes=100;
ts=0;
tend=1;

t=linspace(ts,tend,nframes);
xx=2+3*t; yy=1+4*t;zz=3-2*t;


mlength=length(getframe);

melps=moviein(nframes);

in=1;

for i=1:1:nframes;
    
    tt=linspace(ts,t(i),i);
    x=2+3*tt ; 
    y=1+4*tt ;
    z=3-2*tt ;
    plot3(xx,yy,zz,'-'); 
    axis([-40 40 -40 50 -20 30]);
    hold on;
    plot3(x,y,z,'r-');  
    plot3(x(i),y(i),z(i),'ro');
    

box on;
grid on;
axis equal; axis([0 6 0 6 0 4]);
view([5 -1 2]);

title('f(t)=(2+3t) i + (1+4t) j + (3-2t) k, t \in [0, 1]');
xlabel('x');
ylabel('y');
zlabel('z');
text(1.5,1,3,'(2,1,3)');
text(4.5,5,1,'(5,5,1)');

tt=ts+i*(tend-ts)/nframes;
 tname=['t=' num2str(tt)];
 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) 'cc3d.jpg'];
%  %  imwrite(xe,fname, 'jpeg');
%  %  end;
%  np=1;
%  fps=10;
%  
%  movie(melps,np,fps);
