3 ms·
Super cool! Nice and clean. I had an idea to build something very similar a couple of years ago, but didn't have the skills/time for it. What I built ended up
by mulmboy 4y ago
Super cool! Nice and clean.
I had an idea to build something very similar a couple of years ago, but didn't have the skills/time for it.
What I built ended up being quite visually simple (, pragmatic,), but it's cool in that you can control some of the parameters of the differential equation solver to trade off between speed and accuracy. Mine also shows you where the bodies will go in the future, rather than just a trail of where they have been. And you can click and drag to add a planet with initial velocity and see how the entire system will react immediately and interactively.
I also implemented collision with conservation of momentum (the displayed body radius is much larger than the simulated radius).
https://jurasofish.github.io/gravity/ https://jurasofish.github.io/gravity/