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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education