🚀 Imagine a non-relativistic simple situation.
Assume positions p0, p1, p2, and p3 are three dimensional Cartesian coordinates.
Your spacecraft started from the position p0 at time t0.
Your spacecraft is moving with a constant velocity.
Your spacecraft is expected to reach a star at the location p1 at time t1.
You just heard over the radio that an asteroid has been identified at the location p2 at time t0.
The asteroid is moving with a constant velocity.
The asteroid is expected to reach another star at the location p3 at time t1.
You need to write a code 'safetrip' in MATLAB to return true if the minimum distance between your spacecraft and the asteroid will be more than the distance d during the time interval between t0 and t1, otherwise return false.
Needs more test cases to eliminate the the trivial non-solution that exploits the lack of test cases.
As you can see from Solution 1310620, the test suite is completely inadequate for this problem.
Basic electricity in a dry situation
445 Solvers
Return unique values without sorting
488 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
382 Solvers
724 Solvers
205 Solvers