clc
clear
disp('Zhoria Renfus')

#time intervals

A=30*(pi/180) #how to chang degrees into radants
v0=40
g=9.81

t=0:0.1:2*(v0/g)*sin(A);

height= @(t) v0*t*sin(A) - 0.5*g*t.^2;
speed=@(t) sqrt(v0^2 -2*v0*g*t*sin(A) +g^2*t.^2);

h=height(t);
v=speed(t);

plot(t,h,t,v)

ta=t(h>=15);
ta_intial= ta(1);
ta_final= ta(length(ta))

tb=t(h>= 15 & v>=36)
tb_intial=(1)
tb_final=tb(length(tb))

tc= t(h<=5 | v>= 35)
tc_intial= (1)
tc_final- tc(length(tc))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: