% Draw a spring of given length, width, and number of turns
wid=5;
len=100;
N=50;


A=wid/2;
per=len/N;
omega=2*pi/per;

t=0:0.01:len;
x=A*sin(omega*t)+t;
y=A*cos(omega*t)+50;
plot(x,y)
axis equal