Target Practice


    This program in Visual Basic simulates three dimensional projectile motion.  The goal is to calculate the initial velocity and direction of the projectile which will make it hit the target. 

Visual Basic run time library for version 6 is needed to run the program. The run time library exe file for the correct version may be downloaded from the link below and run to install it.   

The viewer can run the program executable file by clicking the link below. A Projectile Motion screen will appear. On this screen the  X-View, Y-View and Z-View text windows display the values for these coordinates. These values are in meters and indicates the position of the viewer.  The scroll bars below them can be used to change the coordinate values. The Init. Vel., Theta0 and Phi0 are the initial velocity, and initial theta and phi angles respectively, of the projectile. These values can be changed with the scroll bars below them. 

    The 'Initialize' button should be clicked first. A rectangle base will appear on the screen. Then clicking the 'Target' button will make the program use random number generator to choose the coordinates for the target. These coordinate values are used to draw the target on top of a rectangular block.  The X, Y, and Z coordinates of the center of the target will be displayed in the target coordinate windows. Using the coordinate values of the target the viewer should predict the initial velocity and initial polar angles theta0 and phi0 to hit the target. To test the accuracy of the prediction the viewer should click on the 'Trajectory' button which will launch and plot the trajectory of the projectile. A loud sound is produced if the target is hit. 

If the target is not hit the projectile may be launched again without clearing anything by clicking the 'Initialize' button first. This will move the projectile to its initial position. The target will not change. One may change the initial velocity and angle values using scroll bars. The projectile is launched when the trajectory button is clicked. This process may be repeated till the target is hit.

To generate a new target the 'Clear' button should be clicked to clear the display screen. The 'Initialize' button will redraw the rectangular base. The 'Target' button will draw a new target and its coordinate values will be displayed. The above process can then be repeated to hit the target. 

The 'Stop' button will stop the projectile in its track. The 'Exit' button closes the program. Enjoy the simulation.

Run Projectile Motion Program              Visual Basic Run Time Library