ENGFF003 Computer Methods, University of Nottingham,

Post New Homework

Computer Methods - Projectile Motion Simulator

Aim
To create a script that produces a graphical simulation of the motion of a projectile. All submissions must include the following essential components:

1. Code to simulate the path of the projectile under the following two scenarios:

Scenario 1 - No obstacles in the path of the object

Scenario 2 - A wall of a finite height (defined by the user) and an infinitesimal thickness between the point of launch and the intended landing point.

Scenario 1 - No obstacles in the way
1) Ask the user for the height of the launching point.
2) Ask the user for the initial velocity of the object, i.e., the magnitude and direction.
3) Apply the SUVAT equations to calculate the object's trajectory (ignore the air resistance).
4) Finish the simulation when the object hits the ground.
5) Plot the trajectory of the object.
6) Communicate the time of flight of the object to the user as well as the total horizontal distance traveled.
7) Make an animation of the object flying through the air.
8) Make a GUI with a slider that will highlight a point on the graph at each corresponding value of the slider along the entire path of the object once the animation is finished. The program must also show the following information about the highlighted point of the graph:
i. The object's coordinates: Horizontal and Vertical
ii. The time passed since the object was launched.
iii. The ob'ect's velocit : Magnitude and Direction.

Scenario 2 - A wall in the way (2,3,5,7,8 same as Scenario 1)

1) Ask the user for the height of the launching point as well as the wall's height and distance to it.

4) Finish the simulation when the object hits either the ground or the wall.

6) Communicate the time of flight of the object to the user as well as either the total horizontal distance traveled if it hits the ground or the height at which the object hits the wall.

2. The code should be fully documented, i.e. make a VERY extensive use of 'comment statements'.

3. Extension: there is a portion of credits available to those who extend their program beyond the basic tasks. For example, a well thought through GUI, the use of functions, a script that draws the arrows showing the velocity vectors at a highlighted point and many more.

Post New Homework
Captcha

Looking tutor’s service for getting help in UK studies or college assignments? Order Now