This project was inspired by, and largely came from, this tutorial by Hunar Ahmad. The main difference in my implementation is that, for reasons I cannot determine, the force values in my simulation need to be a couple orders of magnitude smaller than the values used in the tutorial. Aside from that, though, the system is pretty much the same.
This project was named N-Body due to there being
N number particles all imparting forces on each other. As this document from Princeton puts it
An N-body simulation approximates the motion of particles, often specifically particles that interact with one another through some type of physical forces.
Included are some preset rules that I have found to create interesting patterns and entities.
Note: The following simulation may be resource intensive.
For best results, please try this on a desktop
My personal favorite, this amazing set of parameters produces a shape resembling a kiwi bird's head. The head will move around the screen, being pulled towards green particles. This requires all of the red particles to come together. I'll admit to watching it for way longer than is reasonable.
It can deteriorate if either the "nose" gets ripped from the "head", or if it gets caught in the corner for too long.