|
In the first simulation, the initial velocity, initial angle, target distance, and target radius are input by the user. The path of the projectile is then graphically plotted as it is calculated; the program reports whether the target was successfully hit. In the second simulation, the x-axis represents a range of initial velocities and the y-axis represents a range of initial launch angles. For each (velocity, angle) pair, the projectile path is calculated. A color is plotted at the corresponding (x, y) point based on how close the projectile lands to the target. The result is pretty pictures. See the code for single launch and multiple launches. |