fork download
  1. import math as mt
  2. angle = mt.radians(48)
  3. print(angle)
  4. V = 4.993
  5. g = -9.80665
  6. Vx = mt.cos(angle)*V
  7. Vy = mt.sin(angle)*V
  8. position = [0, 1.13]
  9. timestep = 0.00001
  10. Vxt = Vx/timestep
  11. Vyt = Vy/timestep
  12. gt = g/timestep
  13. while(position[1]>0):
  14. Vy = Vy + gt
  15. Vy = Vy - ((0.5*(Vy**2)*0.0006477025*timestep)/(2*0.0095))
  16. Vxt = Vx/timestep
  17. Vyt = Vy/timestep
  18. position[0] = position[0] + Vx
  19. position[1] = position[1] + Vy
  20. print(position[0])
Success #stdin #stdout 0.13s 14316KB
stdin
Standard input is empty
stdout
0.8377580409572782
3.3409691175497795