fork(1) download
  1. import math as mt
  2. angle = mt.radians(48)
  3. print(angle)
  4. V = 4.733
  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. Vx = Vx - ((0.5*(Vx**2)*0.0006477025*timestep)/(2*0.0095))
  16. Vy = Vy - ((0.5*(Vy**2)*0.0006477025*timestep)/(2*0.0095))
  17. Vxt = Vx/timestep
  18. Vyt = Vy/timestep
  19. position[0] = position[0] + Vx
  20. position[1] = position[1] + Vy
  21. print(position[0])
Success #stdin #stdout 0.07s 14384KB
stdin
Standard input is empty
stdout
0.8377580409572782
3.166993450326917