Question: 2) Complete the Python function that begins with the header shown below. The function computes the X and Y coordinates of points along the trajectory

 2) Complete the Python function that begins with the header shownbelow. The function computes the X and Y coordinates of points along

2) Complete the Python function that begins with the header shown below. The function computes the X and Y coordinates of points along the trajectory of a projectile defined by the quadratic equation y(x) =ax+bx+c. The function is given a, b and c, which are the coefficients in the quadratic equation, the horizontal, distance (along the x-axis) the projectile travels and the number of intervals of equal width along the x-axis. Create a list of equally spaced X coordinates from x=0 to x=distance based on the number of intervals. Create a list of Y coordinates, one y coordinate for each x coordinate, using the quadratic equation given above. Return the list of X coordinates followed by the list of Y coordinates. This function is used in question 3. def computeTrajectory (a, b, c, distance, intervals): 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, cand distance using the following equations. zv.cos(@ja ; b = tan(0);c = yo: distance = -b-vb-4ac za 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): 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 (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!