'monkey hunting 'theory of momentum SetVersion(0.9) mathgraph on '/-----------screen adjustment--------------------- tscreen(300,150) : twposition(10,500) : gwposition(10,10) opengscreen(360,480) window(-5,-100)-(145,100) line(-5,0)-(145,0) : line(0,-100)-(0,100) '-----------initial conditon----------------------- g=9.81 : dt=0.01 : a=-g vx2=0 : vy2=0 {free fall} x1=0 : y1=0 data 2, 1, 30,45, 60, 1.0 read m1, m2, v1, ang, x2, e glocate (5,-15):gprint "angle=" glocate (33,-15):gprint "K" glocate (25,-15):gt$=str$(ang):gprint gt$ ang=ang*pi/180 {degree ==> radian } y2=x2*tan(ang) :m=x2 :n=y2 {height of "monkey"} vx1=v1*cos(ang) : vy1=v1*sin(ang) r1=m1/m2 data 2, 1, 9 read c,c1,c2 line(0,0)-(x2,y2),c glocate (5,-5):gprint "m1=" glocate (20,-5):gt$=str$(m1):gprint gt$ glocate (5,-10):gprint "v1=" glocate (20,-10):gt$=str$(v1):gprint gt$ glocate (x2+5,y2+10):gprint "m2=" glocate (x2+15,y2+10):gt$=str$(m2):gprint gt$ glocate (x2+5,y2+5):gprint "x2=" glocate (x2+15,y2+5):gt$=str$(x2):gprint gt$ glocate (x2+5,y2):gprint "y2=" glocate (x2+15,y2):gt$=str$(y2):gprint gt$ '/-----------shot!--------------------------------- dvx1=0 : dvy1=a*(dt/2) dvx2=0 : dvy2=a*(dt/2) *shot 'bullet gosub *Eular1 'falling monkey gosub *Eular2 circle(x1,y1),r1,c1,,,,,f : circle(x2,y2),1,c2,,,,,f if x1