If you shoot a cannon, how far will the cannon ball go before it hits the ground? How high will it go?
Input
Horizontal and Vertical VelocityVm // muzzle velocity (feet/sec) A // cannon elevation angle (degrees)
Time (seconds) to the top of the arc (zero vertical velocity)Vv = sin(A) * Vm // vertical velocity (feet/sec) Vh = cos(A) * Vm // horizontal velocity (feet/sec) Note: Depending on which programming language you use, you may need to convert angles in degrees to radians. For example, the Python sin and cos functions require radians. Radians = Degrees x Pi / 180 (Pi is approximately 3.14159) (1 radian is approximately 57.296 degrees) (1 degree is approximately 0.0174532925 radians)
Total time (seconds) of flight - up and then downTtop = Vv / 32.0 Note: 32.0 = acceleration of gravity (feet/sec/sec)
Horizontal distance (feet)Ttotal = 2 * Ttop
Vertical distance (feet) to top of arc (zero vertical velocity)Dh = Ttotal * Vh
Dv = (Vv)2 / (2 * 32.0) Note: 32.0 = acceleration of gravity (feet/sec/sec)
Note: Go
here for more information on the calculation
Plot the cannonball's trajectory.