I was wondering if you could use Barnes-Hut simulation beyond what it was originally intended to be. For many Barnes-Hut algorithms, the forces are only considered for a single quadrant, the centroid, or the stellar body. Then, the algorithm branches out from there, affecting areas of influence and quadrants recursively. For instance:
Seems like the above Barnes-Hut algorithm was based on the central body from the animation.
Would performing Barnes-Hut iteratively across all bodies, treating each body in-turn as the centroid, result in an accurate representation of an n-body problem where the sum force of gravity of all bodies is considered? Or am I misunderstanding exactly what the Barnes-Hut algorithm is?
If I'm misunderstanding the algorithm, can somebody re-explain exactly how this algorithm works? For anyone who understands programming to some degree, could anyone look at this project and tell me if I'm missing something huge here? It's a Java GitHub implementation of the Barnes-Hut algorithm, but I've iterated it across all bodies (which may be incredibly stupid). Also-- yes, I know that's not how time works. Note: Credit due to original professor, as noted on GitHub.
Also, for those who aren't tech-savvy, can you look at this GIF and see anything inherently wrong? Red is less mass, white is more mass; yellow are two or more collided masses. Once the third yellow dot (combined mass) appears, things get interesting. I can't tell if interesting good, or interesting... bad.