function  [xb,yb] = PlanSin( tp,xb_i,yb_i,xb_f,yb_f,AMP,NP )

%-- Tipo de planeamento ------------------------------------------------------------
 t = sqrt((xb_f-xb_i)^2+(yb_f-yb_i)^2);
 Bx = linspace(0,t,length(tp)); 
 
 T=t/NP; 
 By = AMP*sin(2*pi*Bx/T);
 
 P = [Bx;By;ones(1,length(Bx))]; 
 ang = -atan2(yb_f-yb_i,xb_f-xb_i);
 T=[ cos(ang) sin(ang) xb_i ; -sin(ang) cos(ang) yb_i ; 0 0 1  ]; 
 Rp = T*P;
%-----------------------------------------------------------------------------------
 xb = Rp(1,:);
 yb = Rp(2,:);

 subplot(2,1,1), plot(P(1,:),P(2,:),'r'), 
 subplot(2,1,2), plot(Rp(1,:),Rp(2,:),'b')
 axis([ 0 max([xb_i xb_f])+0.1+AMP min([yb_i yb_f])-0.1-AMP max([yb_i yb_f])+0.1+AMP])
 pause, close