Cody

Problem 44365. An asteroid and a spacecraft

Solution 1335604

Submitted on 11 Nov 2017 by Svyatoslav Golousov
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
p0 = [0 0 0]; p1 = [1 1 1]; p2 = [2 2 2]; p3 = [3 3 3]; t0 = 0; t1 = 1; d = 1; ok = true; assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

s = 3.4641 3.4641 3.4641 3.4641 3.4641 3.4641 3.4641 3.4641 3.4641 3.4641 3.4641

2   Pass
p0 = [3 3 3]; p1 = [2 2 2]; p2 = [2 2 2]; p3 = [3 3 3]; t0 = 0; t1 = 1; d = 1; ok = false; assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

s = 1.7321 1.3856 1.0392 0.6928 0.3464 0 0.3464 0.6928 1.0392 1.3856 1.7321

3   Pass
p0 = [1 2 3]; p1 = [4 5 6]; p2 = [3 2 1]; p3 = [6 5 4]; t0 = 10; t1 = 20; d = 2; ok = true; assert(isequal(safetrip(d, t0, t1, p0, p1, p2, p3), ok))

s = 2.8284 2.8284 2.8284 2.8284 2.8284 2.8284 2.8284 2.8284 2.8284 2.8284 2.8284

Suggested Problems

More from this Author100

Community Treasure Hunt

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

Start Hunting!