As a disclaimer this isn't a showcase of my brilliant programming or something that should be used as a metric of my computational ability. This is a small passion project that I spent a Thursday morning on merited a spot here for being slightly less boring than most of my coding projects.

Back in 2019 I finished off my senior year of high school with a bunch of free time and very little instruction during my AP Computer Science course. As a result, my friends and I began designing our own miniature passion projects and games from the limited Java we had learned and we began having an informal competition in designing better and better video games to pretend we weren't complete novices when it came to programming.
I really loved the gratification from the experience and designing my own poorly constructed versions of chess and tower defense games was how I learned to code, albeit not very well, and as I got into MIT and found myself with a bunch of instruction and very little free time I let this hobby fall to the side.
After two and a half years, making the switch from Java to Python, and finishing up my duties as a TA for my Computational Physics class I found myself again with more free time and an interest in returning to similar useless coding projects for the fun of it. I wanted to work on something vaguely related to Physics and after seeing this video at 5AM I was inspired to try something similar.

Old habits die hard as a Physics student so naturally I started with the simplest case of a two body orbit where I get to assume that m<<M.
After working out (most) of the noticeable bugs here I moved onto the two body problem with each having a mass on the same order of magnitude as the order.
With this (mostly) done it was onto the most general N body problem I could design, though I limited myself to only about several objects at once given the quality of code here.
It was here about three hours in that the limits of Pygame's collision logic and the latency between the screen updates really killed my dreams of anything more realistic for this simulation and I stopped here, to be picked up again sometime later down the road. 

You may also like

Back to Top