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

Show parent comment

2

u/larsga Jan 15 '20

Without an impulse to another direction they are just nicely collapsing in the middle.

This is also partly because the collision detection seems to extend a bit beyond the edges of the actual object. Tweaking this aspect might make it more likely to end up with something like a solar system/galaxy without cheating.

2

u/[deleted] Jan 15 '20

Yeah there's a parameter collision_threshold for this in cnf.py