MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

This Challenge is to solve Question E, Armageddon, of the USC ACM Spring 2012 Contest.

An asteroid has been detected that will traverse the center of the earth if it is not deflected. The Splitter missile will bisect the asteroid with an included angle (>0, <180 degrees), based on its composition. The asteroids distance(to center of earth), velocity, and split angle will be provided. The Splitter missile velocity is also provided. Launch occurs from the earth surface nearest the asteroid. Miscellaneous details: Earth Radius 6378.1 km, velocities in km/sec, distance in km , and angle in degrees.

Return the Maximum Time Prior to Launch, nothing hitting the earth, to two decimal places.

**Input: [ Asteroid Distance, Angle of Split, Asteroid Velocity, Missile Velocity ]**

**Output: [Maximum Time Prior to Launch]**; if too late return -1;

The full USC data file

**Example:**

**Input: 63781.0 20.9514 6378.1 6378.1**

**Output: 0.00** as immediate Launch is required

Input 47835.75,15,6000,5000 returns -1.

Geometry Hint: Draw a circle and a line from the center of approximately 2 radius. Take a ruler pivoting from the end of the line and rotate the ruler until it touches the circle.

11 correct solutions
7 incorrect solutions

Last solution submitted on Dec 31, 2014

1 player likes this problem

2 Comments

@bmtran
on 9 Dec 2012

deducing Richard's solution from the test suite

Richard Zapor
on 9 Dec 2012

Solution set fixed - oops.

2 Comments