Whoa, boy, that sure looks like one! And a big one at that.
I'm tracking it down right now... there seems to be a hint in that if you raise the planet's mass to 6000 instead of 1000, the circular orbit returns. That at least gives me a clue...
Edit: and if you do the same transform for the Lagrange Points thread, (making the planet's mass 600 instead of 100), it fixes that, too. The LP is still unstable, but sticks around for nearly a full rotation... which sounds more reasonable.
Edit2: Great! Random, thank you for finding that, I can't believe how long that bug stuck around! Turns out, the RK4 algorithm was working nicely to keep things in orbits around stars... but it was completely broken for planets. Planets would attract at about 1/6 the strength, and with way less precision. Which is why I never really managed to get a moon in a nice orbit around a planet before... and why the Lagrange points weren't working... etc etc. Thank you thank you thank you!
Check out this new setup, then, with a moon in orbit around a planet (a highly elliptical orbit, granted... I didn't spend too much time setting inital conditions. But before this fix, the asteroid would be quickly flung off with the same setup. Now, it is trapped in the planet's gravity well.)
Code: Select all
Gravity Fun at TestTubeGames.com: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 3,y0: -8,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 102,y0: 15,vx: 0.71,vy: -3.06,t0: 70.2,who: 2,m: 100], [x0: 109,y0: -50,vx: -1.09,vy: -2.75,t0: 496.8,who: 3,m: 0]