r/Python • • Jan 14 '20

I made a gravity simulation https://github.com/phgilde/gravity_simulation

1.8k Upvotes

82 comments sorted by

View all comments

33

u/[deleted] Jan 14 '20

15

u/hurix Jan 15 '20

Could you add rotation to everything? Like they all rotate around a random point around the center of the screen from the beginning. Without an impulse to another direction they are just nicely collapsing in the middle.

I would like to know what changes you need in this system to have moons get formed in stable orbits.

9

u/[deleted] Jan 15 '20

I actually implemented that! You can change m0mass in environment.py to whatever you want and enable DO_LOCK.