Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #projectile_motion.py
- t = 0.00
- dt = 0.01
- g = 9.81
- x0 = 0
- y0 = 0
- v0x = 2.5
- v0y = 2
- x = x0
- y = y0
- print("t\tx\ty")
- print("-----------------------")
- while y >= 0:
- x = x0 + v0x * t
- y = y0 + v0y * t - 0.5 * g * t**2
- print("{:.3}\t{:.4}\t{:.4}".format(t, x, y))
- t += dt
Add Comment
Please, Sign In to add comment