from visual import*; ###Create ball object ball = sphere(pos=(0,10,0), radius =1.0, color=(1,0,0)); cliff = box(pos=(-10,5,0), width = 20, length = 21, height = 8); ground = box(pos =(0,-.5,0),width = 200, length = 201, height = 1, color=(0,1,0)); gravity = vector(0,-9.81,0); scene.autoscale = 0; scene.range = 20; v = vector(5,10.0,0); ### put in air resistance Fair = 1/2rhoCAv^2 rho = 1.2; C = 0.5; br = 0.05; mball =1; pi = 3.14159265 A = pi*br*br def Fair(v): return 0.5*rho*C*A*mag2(v)*norm(v); ##* dt = 0.0005; rate(50); while ball.y > 0.5: if scene.mouse.clicked: v = v+gravity*dt-1/mball*Fair(v)*dt; #print Fair(v) ball.pos = ball.pos + v*dt;