Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 1875. GJam: 2013 China Event: Cannon Angle

Created by Richard Zapor

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.


Problem Group

Solution Statistics

20 correct solutions 6 incorrect solutions
Last solution submitted on May 07, 2015

Problem Comments