Write a program to calculate the trajectory (flight path) of a soccer ball when it is kicked by a player inside the field of play, and display the result of the kick. The program calculations will include the effects of gravity and the drag of air resistance on the ball.
We will consider the field is the "standard" size with a length FL = 105m and a width FW = 68m.
The goal has a width GW = 7.32m and a height GH = 2.44m.
We will assume the "centre spot" is the origin of the x and y axes, with axes in the directions shown above. The height of the ball above the ground is in direction z.
Then the coordinates of field are:
- Top touchline (edge) is at y = +34m = ½FW
- Bottom touchline (edge) is at y = -34m = -½FW
- Right goal line edge is at x = 52.5m = ½FL
The player is in the field of play, inside the rectangle of touchlines and goal lines.
The right goal is located at x = 52.5m = ½FL and has |y| < 3.66m = ½GW and 0 < z < 2.44m = GH.
The left goal is at x = -52.5m = ½FL and also has |y| < 3.66m = ½GW and 0 < z < 2.44m = GH.