A ball is kicked from the roof of a 50 feet tall building with an initial veloci
ID: 2074405 • Letter: A
Question
A ball is kicked from the roof of a 50 feet tall building with an initial velocity v.-40 n/s at an angle -300 Write a script file that asks the user to input the initial velocity, and angle in degrees and determine the location where the ball hits the ground and the maximum height it reaches. Display single fprintf statement in decimal format with two decimals. Also plot the trajectory of ball. The your results in a kinematic equations for the projectile motion are given by: (50 Points) y o Hint: Solve for t by finding roots of the polynomial.Explanation / Answer
clc
clear all
close all
v= input('initial velocity');
th= input('angle of throw');
yo=50; % roof height
k=[0.5*9.81 -v*sind(th) -yo];
t= roots(k); % time taken to reach ground
if t(1)<0
t=t(2);
elseif t(2)<0
t=t(1);
end
xo=0;
x=xo+(v*cosd(th)*t); % distance from the base of root in x direction
ymax= yo+ ((v*sind(th))^2)/(2*9.81);
disp(x)
disp(ymax)
t1=0:0.1:t;
y= yo + (v*sind(th).*t1)-(0.5*9.81*t1.^2);
plot(t1,y);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.