Problem 1875. GJam: 2013 China Event: Cannon Angle
This Challenge is derived from GJam 2013 China Captain Hammer. The problem is modified to fit within Cody dimensions.
The Challenge is to return the lower angle of a cannon given a target distance and an initial cannonball velocity. Gravity is a constant at 9.8m/sec^2, A valid solution is assured. (Error tolerance 2e-6).
Input: [v d] Velocity and Distance in meters.
Output: theta in units of degrees with an accuracy of 2e-6
Competition Summary: Best Time of 8 minutes, 755/1070 completed
The winner completed all three GJam China Challenges in 26 minutes with second at 43 minutes.
Solution Stats
Problem Comments
-
3 Comments
It's not enough to bash in heads, you've got to bash in minds!
Richard, last test was not complete so I added the assert statement that was missing.
Thank you
Solution Comments
Show commentsProblem Recent Solvers20
Suggested Problems
-
Project Euler: Problem 4, Palindromic numbers
1042 Solvers
-
Create One Large Eye of size N x N Quickly?
93 Solvers
-
Get the length of a given vector
10948 Solvers
-
How many monitors are connected ?
152 Solvers
-
Area of an equilateral triangle
6191 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!