function test(L,theta)

for k=1:length(theta),

    R = [ 0 L*cos(theta(2,k)-pi/2); 0 L*sin(theta(2,k)-pi/2) ];
%    subplot(1,2,1)
    plot( R(1,:),R(2,:),'r', 0,0,'ro' ), axis('equal'), axis(1.1*[-L L -L L])
    pause(0.01)
    %drawnow;
    
%    subplot(1,2,2)
%    plot(theta(1,1:k),theta(2,1:k)*180/pi,'r', theta(1,:),sin(2*pi*theta(1,:)/6)*90,'b-.') 
%    xlabel('Time(s)'), ylabel('Theta(deg)')

end