1. Write a program "Projectile simulator". a. The program defined the following functions: initial values () - reads initial velocity and angle of the projectile in degrees form the user, convert the angle to radians, and returns as a tuple. simulator (v, a_rad) - takes velocity and angle as parameters and calculates and returns a list of (x, y) coordinates (as tuples) for the duration of the projectile You will use the following constants and formulas: g = 9.81 global points = 100 math.pi = 3.141592 (defined in math class) a_rad = math.radians(angle in degrees) total time 2v sin(angle in radinas) 9 delta_t (Time increment) = total time / points x = v* cos(a_rad) * time y = v* sin(a_rad) * time - (g* time ²)/2 Where time starts from 0 and incremented by delta_t for each step (point) write_data (data) - takes a list of x-y coordinates (data) and writes into csv file. max_height (data) - finds the largest value of y and returns it. b. In the main part of the program invoke all functions above and display projectile information: initial velocity and angle, and the maximum height. c. Open projectile.csv file in Excel and plot the graph of the projectile. Compare the max height from the graph to the value you obtained in the function.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Urgent Answer plz

PYTHON PROGRAM CODING QUESTION
1. Write a program "Projectile simulator".
a. The program defined the following functions:
initial_values () - reads initial velocity and angle of the projectile in degrees
form the user, convert the angle to radians, and returns as a tuple.
simulator (v, a_rad) - takes velocity and angle as parameters and calculates
and returns a list of (x, y) coordinates (as tuples) for the duration of the projectile
You will use the following constants and formulas:
g = 9.81
global points = 100
math.pi = 3.141592 (defined in math class)
a_rad = math.radians(angle in degrees)
total time =
2v sin(angle in radinas)
9
delta_t (Time increment) = total time / points
x = v* cos(a_rad) * time
y = v* sin(a_rad) * time - (g* time ²)/2
Where time starts from 0 and incremented by delta_t for each step (point)
write data (data) - takes a list of x-y coordinates (data) and writes into csv file.
max_height (data) - finds the largest value of y and returns it.
b. In the main part of the program invoke all functions above and display
projectile information: initial velocity and angle, and the maximum
height.
c. Open projectile.csv file in Excel and plot the graph of the projectile.
Compare the max height from the graph to the value you obtained in the
function.
Transcribed Image Text:PYTHON PROGRAM CODING QUESTION 1. Write a program "Projectile simulator". a. The program defined the following functions: initial_values () - reads initial velocity and angle of the projectile in degrees form the user, convert the angle to radians, and returns as a tuple. simulator (v, a_rad) - takes velocity and angle as parameters and calculates and returns a list of (x, y) coordinates (as tuples) for the duration of the projectile You will use the following constants and formulas: g = 9.81 global points = 100 math.pi = 3.141592 (defined in math class) a_rad = math.radians(angle in degrees) total time = 2v sin(angle in radinas) 9 delta_t (Time increment) = total time / points x = v* cos(a_rad) * time y = v* sin(a_rad) * time - (g* time ²)/2 Where time starts from 0 and incremented by delta_t for each step (point) write data (data) - takes a list of x-y coordinates (data) and writes into csv file. max_height (data) - finds the largest value of y and returns it. b. In the main part of the program invoke all functions above and display projectile information: initial velocity and angle, and the maximum height. c. Open projectile.csv file in Excel and plot the graph of the projectile. Compare the max height from the graph to the value you obtained in the function.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,