Advertisement
logancberrypie

Gravity calculator

Feb 5th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. velocitys = [0,1.7155,2.426,2.97,3.43]
  2. distances = [0,0.15,0.3,0.45,0.6]
  3. mean = 0
  4. total = 0
  5. for i in range(0,4):
  6.     for j in range(i,5):
  7.         if (distances[i]!=distances[j]):
  8.             total += 1
  9.             print(i,"compared to",j)
  10.             temp = (velocitys[j]**2 - velocitys[i]**2)/ (2*(distances[j]-distances[i]))
  11.             mean += temp
  12.             print(temp)
  13.  
  14. print("from ",total,"results the mean of graity is ",mean/total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement