min_teta1 = -185 ; max_teta1 = 185 ; min_teta2 = -120+90 ; max_teta2 = 70+90 ; min_teta3 = -120-90 ; max_teta3 = 155-90 ; min_teta4 = -350 ; max_teta4 = 350; global target nt=12; t0=[2059;0;1990]; dx1=100*[-2;0;-3]; dx2=150*[-1;0;0]; dx3=150*[0;0;1]; tetas0=zeros(1,4); target=t0; for i=1:nt+1 if (i<100) dx=dx1; elseif (i<200) dx=dx2; else dx=dx3; endif if (i==1) dx=0; endif target=target+dx; [tetas fn info]=fsolve(@erro,tetas0); if (info != 1) info endif tetas0=tetas; [x y z]=cg3d(tetas(1:4)); XX(i,1:5)=x; YY(i,1:5)=y; ZZ(i,1:5)=z; hold off for ii=1:i##i##(max(1,i-10)):i hh3=plot3(XX(ii,:),YY(ii,:),ZZ(ii,:),"o-"); set(hh3,"linewidth",2); set(hh3,"markersize",15); hold on ##hh2=plot3(XX(ii-1,:),YY(ii-1,:),ZZ(ii-1,:),"r-"); ##set(hh2,"linewidth",1); ####set(hh2,"markersize",5); ##hold on; ##hh1=plot3(XX(ii-2,:),YY(ii-2,:),ZZ(ii-2,:),"r-"); ##set(hh1,"linewidth",1); ####set(hh2,"markersize",5); hold on; axis([-4000 4000 -4000 4000 -4000 4000]); endfor hh3=plot3(XX(i,:),YY(i,:),ZZ(i,:),"o-"); set(hh3,"linewidth",2); set(hh3,"markersize",15,"color","red"); pause endfor