Consider a ball resting on the ground that is then kicked. This gives it a velocity of v at an angle of 8 degrees from the horizontal x-axis. We can represent this ball using an object ball Ball() and store its (x,y) position in ball.position. We want to use its r ball.step(delta_t) to update the position of the ball after a period of time delta_t has passed. Complete the code to achieve this. You may assume that acceleration due to gravity is 9.81ms the ball is a point mass, there is no air resistance, and that the ball will collide inelastically with the ground! For example: 10 Test ball Ball(theta 30, v 100) fort in range(200): .9 >x ball Ball () ball position = [x/y] ball.step(delta_t 0.05). print (f'Ball is at x-(ball.position [0]:.2f)m, y-(ball.position [1]:.2f)m') # Check position Result Ball is at x-866.03m, y-11.95m

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

Write using python

Consider a ball resting on the ground that is then kicked. This gives it a velocity of v at an angle of 8 degrees from the horizontal x-axis. We can represent this ball using an object ball = Ball() and store its (x,y) position in ball.position. We want to use its m
ball.step(delta_t) to update the position of the ball after period of time delta_t has passed.
Complete the code to achieve this. You may assume that acceleration due to gravity is 9.81ms 2, the ball is a point mass, there is no air resistance, and that the ball will collide inelastically with the ground!
fort in range (200):
For example:
Test
ball Ball(theta = 30, v = 100)
O
ball.step(delta_t = 0.05)
for t in range(10):
ball-Ball ()
ball position = [x, y]
print (f'Ball is at x=(ball.position [0]:.2f}m, y=[ball.position [1]:.2f}m') # Check position
ball Ball(theta 10, v= 5)
ball.step(delta_t = 0.01)
for t in range(108):
9
→x
print (f'Ball is at x=(ball.position [0]:.2f}m, y=[ball.position [1]:.2f}m') # Check position
ball Ball(theta = 80, v = 600)
ball.step(delta_t = 8.1)
print (f'Ball is at x={ball.position [0]:.2fm, y={ball.position [1]:.2f}m') # Check position
Result
Ball is at x-866.03m, y-11.95m
Ball is at x=0.49m, y=8.84m
Ball is at x=1041.89m, y=5423.25m
Transcribed Image Text:Consider a ball resting on the ground that is then kicked. This gives it a velocity of v at an angle of 8 degrees from the horizontal x-axis. We can represent this ball using an object ball = Ball() and store its (x,y) position in ball.position. We want to use its m ball.step(delta_t) to update the position of the ball after period of time delta_t has passed. Complete the code to achieve this. You may assume that acceleration due to gravity is 9.81ms 2, the ball is a point mass, there is no air resistance, and that the ball will collide inelastically with the ground! fort in range (200): For example: Test ball Ball(theta = 30, v = 100) O ball.step(delta_t = 0.05) for t in range(10): ball-Ball () ball position = [x, y] print (f'Ball is at x=(ball.position [0]:.2f}m, y=[ball.position [1]:.2f}m') # Check position ball Ball(theta 10, v= 5) ball.step(delta_t = 0.01) for t in range(108): 9 →x print (f'Ball is at x=(ball.position [0]:.2f}m, y=[ball.position [1]:.2f}m') # Check position ball Ball(theta = 80, v = 600) ball.step(delta_t = 8.1) print (f'Ball is at x={ball.position [0]:.2fm, y={ball.position [1]:.2f}m') # Check position Result Ball is at x-866.03m, y-11.95m Ball is at x=0.49m, y=8.84m Ball is at x=1041.89m, y=5423.25m
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
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.
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