Imagine throwing, hitting, or kicking a ball, be it a baseball, football, basketball, or soccer ball. Suppose that you know the ball’s initial velocity and the initial angle that the ball’s trajectory...



Imagine throwing, hitting, or kicking a ball, be it a baseball, football, basketball, or soccer ball. Suppose that you know the ball’s initial velocity and the initial angle that the ball’s trajectory makes with a line parallel to the ground, which we assume is level. Some basic equations from physics describe this scenario. Assume that at time T = 0, you are given the following values:


V0 is the ball’s initial velocity in meters per second.


T0 is the initial angle, in degrees, that the ball’s trajectory makes with the ground.


(x0, y0) are the ball’s initial coordinates. If we place the origin of the coordinate system at the ball’s initial position—when it leaves your hand, strikes the bat, or so on—the initial coordinates are (0, 0). This origin is h0 meters above the ground.


At time t seconds, the ball has the coordinates (xt, yt) and velocity vt, given as a function of t as follows:


xt = t x v0 x cos T0


yt = t x v0 x sin T0 - g x t2 / 2, where g is the acceleration due to Earth’s gravity, or 9.78049 meters per second per second vt2 = v02 x cos2 T0 + (v0 x sin v0 - g x t)2






Write a program that calculates the ball’s velocity and position at any given time. Realize that if the ball is at (xt, yt), its height above the ground is yt + h0. The program should read the ball’s initial velocity v0, initial angle T0, and initial height h0. It should also read the time t, in seconds, at which the ball’s status is desired. The program should produce clearly labeled output.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here