Task

Write a program that will ask the user for the velocity and angle at which we shot a cannon ball, and it prints out how far the ball will fly.

You may need this: $$s = \frac{v^2\sin 2\phi}{g},$$ where $s$ is the distance, $v$ is the velocity, $\phi$ is the angle, and $g$ is the eighth letter of the Slovenian alphabet.

Try this: the distance is the largest when the angle equals 45 degrees. Check this by trying 45 and 46 at the same velocity. Also, try 50 degrees. If the ball goes backwards in this case, something is wrong. (Hint: this page on Wikipedia can give you a useful association.)

Fun fact

The highschool physics teacher who was convincing you that paths of projectiles follows a parabolla was a closet flat-earther. Read more ...

(Image source: James Stanton, Twitter)

Last modified: Tuesday, 8 October 2024, 11:09 AM