Question: 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)=ax2+bx+c.
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)=ax2+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.
=
2
2cos
()2 ; = tan() ; = 0; = 224
where G is gravity at 9.81 m/s2, v0 is the initial velocity of 25.25 m/s, is the launch angle in
degrees, y0 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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
