Problem 1109. USC Spring 2012 ACM: Armageddon
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.
Solution Stats
Problem Comments
-
2 Comments
My (independent) solution agrees with the judges.
The Expected Solution's were corrected based on Bryant's geometry guidance.
Solution Comments
Show commentsProblem Recent Solvers10
Suggested Problems
-
2409 Solvers
-
Determine if a Given Number is a Triangle Number
377 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
372 Solvers
-
Selecting books on MATLAB for experts and beginners (blindfolded)
75 Solvers
-
Getting the indices from a matrix
648 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!