Guest User

Untitled

a guest
Dec 10th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #projectile_motion.py
  2. t = 0.00
  3. dt = 0.01
  4. g = 9.81
  5.  
  6. x0 = 0
  7. y0 = 0
  8. v0x = 2.5
  9. v0y = 2
  10.  
  11. x = x0
  12. y = y0
  13.  
  14. print("t\tx\ty")
  15. print("-----------------------")
  16. while y >= 0:
  17. x = x0 + v0x * t
  18. y = y0 + v0y * t - 0.5 * g * t**2
  19. print("{:.3}\t{:.4}\t{:.4}".format(t, x, y))
  20. t += dt
Add Comment
Please, Sign In to add comment