donotturnoff

Planets

Introduction

On the same day that we made the string vibration simulator in January 2019, we also made a simulation of particles acting under gravity. We expected it to be quite a quick project, but the collision handling turned out to be quite time-consuming (we spent about an hour puzzled by planets bouncing at weird angles, before it turned out that I'd accidentally swapped an x and a y somewhere). We could have solved the differential equations exactly, but we opted to use the good old forward Euler method because, as is well-known, there is no known solution to the differential equations for more than two bodies under the effect of gravity. The fact that we used a numerical method to solve the equations means that some orbits which should be stable don't persist forever.

Currently, there is only one configuration shown. In the next couple of weeks, I'm going to add an interface for defining custom planets.

Files

Screenshots

I'll add screenshots once I've created the new interface.

To do

Related projects