Shooting a bullet
Sándor Kabai
Shoot a bullet vertically from a car moving with constant speed. After fllowing a parabolic trajectory the bullet will fall back into the gun independently of the starting vertical speed of the bullet or the horizontal speed of the car, as long as air resistance is neglected
Shoot a bullet vertically from a car moving with constant speed. After fllowing a parabolic trajectory the bullet will fall back into the gun independently of the starting vertical speed of the bullet or the horizontal speed of the car, as long as air resistance is neglected
In[]:=
Manipulate[a=1.5;vel=0.9;mp=Translate[GraphicsComplex[PolyhedronData["MathematicaPolyhedron","VertexCoordinates"],Polygon[PolyhedronData["MathematicaPolyhedron","FaceIndices"]]],{0,0,1}];field={Green,Polygon[{{-4,-2,-2},{-4,2,-2},{10*2,2,-2},{10*2,-2,-2}}]};bullet=Translate[{RGBColor[0.9,0.4,0.6],Sphere[{0,0,0},0.5]},{vel*(10*x+10),0,10*(1-x^2)*a}];par=Scale[ParametricPlot3D[{10*x+10,0,10*(1-x^2)*a},{x,-1,1}][[1]],{vel,1,1},{0,0,0}];gun={RGBColor[0.3,0.7,1],Cylinder[{{vel*(10*x+10),0,0},{vel*(10*x+10),0,3}},0.8]};body=Cuboid[{-4,-1,-1},{2,1,0.5}];w1=Cylinder[{{1,-1.3,-1},{1,-1,-1}}];w2=Cylinder[{{1,1.3,-1},{1,1,-1}}];shaft1={Red,Cylinder[{{1,-1.5,-1},{1,1.5,-1}},0.3]};w3=Cylinder[{{-3,-1.3,-1},{-3,-1,-1}}];w4=Cylinder[{{-3,1.3,-1},{-3,1,-1}}];shaft2={Red,Cylinder[{{-3,-1.5,-1},{-3,1.5,-1}},0.3]};car=Translate[{{Yellow,w1,w2,w3,w4},shaft1,shaft2,body,Text[WRI,{-1,-1,-0.5}],mp},{vel*(10*x+10),0,0}];Graphics3D[{car,gun,bullet,par,field},ImageSize->{380,380},Boxed->False,SphericalRegion->True,ViewAngle->Pi/50,ViewPoint->{5,-10,3},PlotRange->{{-8,23},{-5,5},{-6,20}}],{{x,-0.9,"shoot bullet and move car"},-0.9,0.9},TrackedSymbols->Manipulate]
Out[]=

