Cody

Problem 42915. How Far Can You Throw Something?

Solution 2152325

Submitted on 6 Mar 2020 by Are Mjaavatten
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
format compact hstart=0;vstart=50; [long_d thetamax]=ballistics(hstart,vstart) dl=abs(long_d-254.841997961264) dt=abs(thetamax-45) assert(and(dl<1e-6,dt<1e-6))

long_d = 254.8420 thetamax = 45.0000 dl = 5.6843e-14 dt = 7.1054e-15

2   Pass
hstart=100;vstart=20; [long_d thetamax]=ballistics(hstart,vstart) dl=abs(long_d-99.08340778978895) dt=abs(thetamax-67.63189529197281) assert(and(dl<1e-6,dt<1e-6))

long_d = 99.0834 thetamax = 67.6319 dl = 2.8422e-14 dt = 4.1620e-07

3   Pass
hstart=100;vstart=50; [long_d thetamax]=ballistics(hstart,vstart) dl=abs(long_d-340.4597531532057) dt=abs(thetamax-53.1842963916761) assert(and(dl<1e-6,dt<1e-6))

long_d = 340.4598 thetamax = 53.1843 dl = 1.7053e-13 dt = 3.7927e-07

4   Pass
hstart=50;vstart=100; [long_d thetamax]=ballistics(hstart,vstart) dl=abs(long_d-1068.198437549283) dt=abs(thetamax-46.33996589024096) assert(and(dl<1e-6,dt<1e-6))

long_d = 1.0682e+03 thetamax = 46.3400 dl = 4.5475e-13 dt = 2.6227e-07

5   Pass
hstart=30;vstart=30; [long_d thetamax]=ballistics(hstart,vstart) dl=abs(long_d-117.9889278221855) dt=abs(thetamax-52.13289838740581) assert(and(dl<1e-6,dt<1e-6))

long_d = 117.9889 thetamax = 52.1329 dl = 1.4211e-14 dt = 2.6085e-07

Suggested Problems

More from this Author80

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!