The objective of this final project is to simulate a simple case of galaxy collision using the Barnes-Hut algorithm for N-body problems [O(N²) → O(N log N)]. This project was completed as part of AST 390: Special Topics in Astrophysics and Cosmology (Computational Astronomy) at Stony Brook University Spring 2025. An example collision is provided in galaxy_collision_true.gif.
The code structure is based on the Barnes-Hut Simulator GitHub repository and article.