codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
import math sats = 30 w = 5 output = "Gravity Fun at TestTubeGames.com: [ForceGr: r^(-2),Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 2,m: 1000,c: 2,w:" + str(w) + "]" period = 360.0 / w dist = ((period / (2 * math.pi))**2*1000)**(1.0/3.0) vel = (1000.0 / dist)**(.5) for a in range(sats): output = output + ", [x0: " + str(dist * math.cos(2*math.pi*a/sats)) + ",y0: " + str(dist * math.sin(2*math.pi*a/sats)) + ",vx: " + str(vel * -math.sin(2*math.pi*a/sats)) + ",vy: " + str(vel * math.cos(2*math.pi*a/sats)) + ",t0: 0,who: 3,m: 0,c: 5]" print output
Private
[
?
]
Run code
Submit