Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Enter Values: v (velocity), theta (launch angle), Initialize Variables: t=0 (time), tstep =0.1 (time step between calculations) a=32 (Gravitational constant in ft per sec2) Find
Enter Values: v (velocity), theta (launch angle), Initialize Variables: t=0 (time), tstep =0.1 (time step between calculations) a=32 (Gravitational constant in ft per sec2) Find velocity components before loop: theta = theta PI /180.0 vx=vcos( theta) vy=vsin (theta) Create a Loop (with everthing below inside of it) : t=t+tstep Create a trajectory function that does the following (call it inside this loop): pass t,vx,vy to the trajectory function y=vyt0.5at2x=vxt(Calculateheight)(Calculatehorizontaldistance) Print time, x distance and y height // also detect max height (max y value) then print when it happens return y Loop Until y
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started