Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3) Write a Python program that calls the functions computeTrajectory from question 3 to compute the trajectory of a projectile defined by the quadratic equation
3) Write a Python program that calls the functions computeTrajectory from question 3 to compute the trajectory of a projectile defined by the quadratic equation y(x)=ax*+bx+c. DO NOT rewrite computeTrajectory here! Input the integer number of intervals. Loop as long as the number of intervals is greater than zero. Input the launch angle of the projectile in degrees as a float. If the launch angle is less than or equal to zero display an error message that includes the launch angle as shown in the sample run of the program. Otherwise compute the values of a, b, c and distance using the following equations. zvcas(@ja ; b =tan();c = Ye: distance where G is gravity at 9.81 m/s?, Vo is the initial velocity of 25.25 m/s, e is the launch angle in degrees, yo is the initial height of 2.1 meters and distance is the horizontal distance the projectile travels in meters. Call compute Trajectory to get the list of X and Y coordinates. Display the heading shown in the sample run of the program. In a loop, display the corresponding X and Y coordinates that define the points along the trajectory to 4 decimal places in 12 character positions, one pair of values per line of output. Be sure to include any import statements required by the program. A sample run of the program is shown below. Enter the number of intervals (0): 0 The launch angle, 0, must be greater than zero! Enter the number of intervals (- 0 to quit): 10 Enter the launch angle of the projectile > 0): 37.25 X coordinate y coordinate 0.0000 2.1000 6.5277 6.5464 13.0554 9.9580 19.5831 12.3349 26.1108 13.6771 32.6385 13.9844 39.1662 13.2571 45.6939 11.4949 52.2215 8.6980 58.7492 4.8664 65.2769 0.0000 Enter the number of intervals (- 0 to quit): 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started