from visual import * scene.range = 400 #////Make Axes x_axis = arrow(pos = (-200,0,0), axis = (300,0,0), shaftwidth = 0.1); y_axis = arrow(pos = (-200,0,0), axis = (0,300,0), shaftwidth = 0.1); z_axis = arrow(pos = (-200,0,0), axis = (0,0,300), shaftwidth = 0.1); #put in the physics g = vector(0,-10,0) #// accel of gravity rounded to 10 m/s/s m = 0.200 #mass of ball ball = sphere(pos=(-200,0,0), radius = 15, color = color.red) vi = vector(30,60,0) #initial velocity ball.p = m*vi; dt = 1 # time step t = 0 #clock set to 0 while ball.pos.y > -0.10: if scene.mouse.clicked: scene.mouse.getclick() ball.p = ball.p + m*g*dt ball.pos = ball.pos + (1/m)*ball.p*dt ball_vector = arrow(pos=ball.pos, axis = (1/m)*ball.p) t = t+dt print t,ball.pos #print out time and position