Oh, that's why. Though the choice of .9 is unusual, why does it use .9, instead of 1 second per frame?testtubegames wrote:Yes, good catch there. I went through your math, and ran that simulation with a stopwatch, and found the same discrepancy. And you've got the reason right. It turns out the 'time' in the simulator doesn't exactly match the 'time' in the outside world. There's a conversion you have to do.
So, digging back into it, I see that the simulation runs at (basically) 40 FPS. And during each of those frames, the simulator calculates trajectories and moves the planets .9 seconds ahead. So for every second in the real world, you're seeing 36 seconds in the simulator world. So the orbits you see would go 36 times more rapidly than expected (from your calculations). It looks like your experiment was pretty darn accurate.
Also, this holds for the t0 value in the load-codes, too. So if you put in two identical versions of that asteroid, but offset the t0 by 5.6 units, they will not be a full orbit off. But if you offset it by about 200, the second one will appear just after the first completes an orbit:
Code: Select all
Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 21,ySet: 4], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 100,y0: 0,vx: 0,vy: -3.1622776601683795,t0: 0,who: 3,m: 0], [x0: 100,y0: 0,vx: 0,vy: -3.1622776601683795,t0: 203.4,who: 3,m: 0]
(Off to calculate suitable scaling factors!)