clear all L1 = 0.2; L2 = 0.5; th = 0:pi/20:4*pi; alfa = asin(L1*sin(th)/L2); for i=1:length(th) x1 = L1*cos(th(i)); y1 = L1*sin(th(i)); x2 = L1*cos(th(i)) + L2*cos(alfa(i)); plot([0 x1],[0 y1],'k-','linewidth',3) hold on plot([x1 x2],[y1 0],'r-','linewidth',2) plot(x2,0,'bs','markersize',10) hold off grid on axis([-0.3 0.8 -0.55 0.55]) axis square pause(0.1) end