
%% Draws a snapshot of pendulum
%
%% Usage:
% pendulum_shot(X,Y,Npts,ax);
%% Npts=numpoints to draw circles
%% ax = axis
%


function cylinder_shot(X,Y,Npts,ax);
global k m L0 L g

lw=3;
R=L/20;

myang=linspace(0,2*pi,Npts);
cosang = cos(myang);
sinang = sin(myang);

ang=atan2(Y,X);
xc=X-R*cos(ang);
yc=Y-R*sin(ang);
plot(0,0,'-ko',X+R*cosang,Y+R*sinang,'-b',[0 xc],[0 yc],'-b','LineWidth',lw)

axis(ax);
%axis square
axis equal
drawnow

