Starting from:

$40

Computational Physics-Project 1 Framework 3 Solved

One of the most visually spectacular plays in basketball is the alley-oop dunk, where one player throws the ball into the air near the basket, and their teammate (or, occasionally, themselves) jumps, takes the ball in mid-air, and dunks it into the basket. Getting this play to work requires precise timing and aim for both the passer and the dunker, and while it is usually not a conscious calculation, every player that does it is using physics to figure out when and how to act. In this mini-project, you'll be more deliberately using physics to calculate how to keep an alley-oop from becoming an alley-oops. For simplicity, we will be confining ourselves to two dimensions, with the +𝑥 direction being towards the basket, and the +𝑦 direction being up.

For this project, you will be implementing a program that performs several calculations regarding the setup for an alley-oop dunk. You will need to prompt the user for the distance of the player with the ball from the hoop, in meters, the angle at which the ball is thrown, and the jumping player’s jumping speed, in meters per second. Then, assuming the jumping player is 0.375 meters from the hoop, the jumping player’s maximum reach is 2.35 meters, and that the ball is being thrown from a height of 1.5 meters, calculate the speed, in meters per second, at which the ball needs to be thrown and how long the jumping player must wait, in seconds, to catch the ball at the top of their jump for the alley-oop dunk.

Program Requirements 

•       As with all projects in this course, your program should have a comment at the top that includes your name, the date the program was created, and a brief description of the project, in your own words

•       Import the scipy.constants library

•       Import the numpy library

•       Define a new constant variable and initialize it to the value of scipy’s gravity constant o You can use scipy.constants.g to access the value of gravity

•       Define a new variable to store the jumping player’s distance from hoop, and initialize it to the appropriate value

•       Define a new variable to store the jumping player’s maximum reach, and initialize it to the appropriate value

•       Define a new variable to store the height from which the ball is being thrown, and initialize it to the appropriate value

•       Prompt the user for the following values and store each in new variables you define: o The distance of the player with the ball from the hoop, in meters o The angle at which the ball is thrown

▪ Do not forget to convert from degrees to radians! You can use numpy’s numpy.pi to access the value of pi

o The jumping player’s jumping speed, in meters per second

•       Using the formula you derive from the framework, calculate the velocity of the ball, in meters per second, and store it in a new variable you define o numpy provides access to the sqrt, cos, sin, and tan functions

•       Using the formula you derive from the framework, calculate the how long the jumping player must wait, in seconds, and store it in a new variable you define

•       Using an appropriate message, output the velocity of the ball, in meters per second, using two decimal points of precision

•       Using an appropriate message, output how long the jumping player must wait, in seconds, using two decimal points of precision

•       You are welcome to define any additional variables to store intermediate steps of the equations as you see necessary

•       Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, date, and brief description), comments for each variable, and commented blocks of code

•       Your program source code should be named alleyoop.py 

More products