function [Qnet] = CircleXY(P0, P1, T) % Draw a cirle in the XY plane with center at P1 % starting at point P0 % in T seconds t = [0:0.01:T]; a = t/T; a = (1 - cos(pi*a))/2; r = sqrt( (P0(1) - P1(1))^2 + (P0(2) - P1(2))^2 ); X0 = P1(1) + r; Y0 = P1(2); Z0 = P0(3); dY = P0(2) - P1(2); dX = P0(1) - P1(1); Q0 = atan2(dY,dX); X = P1(1) + r*cos(2*pi*a + Q0); Y = P1(2) + r*sin(2*pi*a + Q0); Z = P0(3) + a*0; TIP = [X ; Y ; Z]; Qnet = []; for i=1:length(TIP) Q = InversePuma(TIP(:,i)); Qnet = [Qnet, Q]; Puma(Q, TIP); end end