GlowScript 2.7 VPython g1=graph(width=400, height=250) xDots=gdots(color=color.green, graph=g1) vDots=gdots(color=color.red,graph=g1) obj=sphere(pos=vector(-1,0,0),radius=0.5,color=color.red) spring = helix(pos=vector(-5,0,0), axis=vector(4,0,0), radius=0.5) wall=box(pos=vector(-5.5,0,0),length=0.5, height=2, width=0.25) t=0; dt=0.01 x=-1 v=0 k=1; m=1 while t<25: rate(200) obj.pos=vector(x,0,0) spring.axis=vector(x+5,0,0) xDots.plot(t,x) vDots.plot(t,v) F=-k*x a=F/m v=v+a*dt x=x+v*dt t=t+dt