100-days-of-rust/Week-08/Day-53_Javelin-Parabolic-Throw
2024-09-16 10:45:03 +02:00
..
day53 Wrote program for Day 53 2024-09-16 10:45:03 +02:00
README.md Add files via upload 2023-03-23 21:14:34 -04:00

Javelin Parabolic Throw

Write a function that takes initial speed (v in m/s) and throw angle (a in degrees) and returns the maximum height and maximum range reached by javelin as a string.

Examples

javelinThrow(36.7, 45) ➞ "Ymax=34m, Xmax=137m"

javelinThrow(51.3, 20) ➞ "Ymax=16m, Xmax=172m"

javelinThrow(100.1, 89) ➞ "Ymax=511m, Xmax=36m"

Notes

  • Javelin starts moving at h=0m.
  • Gravitational acceleration is g=9.81 m/s^2.
  • All results should be rounded to the nearest whole number.