[ create a new paste ] login | about

Link: http://codepad.org/kcIwuNPG    [ raw code | output | fork ]

Python, pasted on Feb 2:
1
2
3
4
5
6
7
8
9
import math
mass = 1000
periods = [1,60,3600]
output =  "Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: " + str(mass) + "]"
for a in periods:
 radius = ((36*a/(2*math.pi))**2*mass)**(1.0/3)
 vel = math.sqrt(mass/radius)
 output = output + ", [x0: 0,y0: " + str(-radius) + ",vx: " + str(vel) + ",vy: 0,t0: 0,who: 3,m: 0]"
print output


Output:
1
Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 0,y0: -32.0195399866,vx: 5.5884639774,vy: 0,t0: 0,who: 3,m: 0], [x0: 0,y0: -490.737510252,vx: 1.42749755282,vy: 0,t0: 0,who: 3,m: 0], [x0: 0,y0: -7521.13565872,vx: 0.364634946483,vy: 0,t0: 0,who: 3,m: 0]


Create a new paste based on this one


Comments: