MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/eorvjg/i_made_a_gravity_simulation/fefvs9u/?context=3
r/Python • u/[deleted] • Jan 14 '20
82 comments sorted by
View all comments
1
How does a gravity simulation work? Like, what’s the math there?
8 u/[deleted] Jan 15 '20 For every particle, you calculate the vector sum of the gravitational Forces to every other particle. That is your acceleration in the next time step. Add this acceleration to the particles current speed and move the particle by this speed.
8
For every particle, you calculate the vector sum of the gravitational Forces to every other particle. That is your acceleration in the next time step. Add this acceleration to the particles current speed and move the particle by this speed.
1
u/homelesspancake Jan 15 '20
How does a gravity simulation work? Like, what’s the math there?