This project is a simulation of a galaxy using the Barnes-Hut algorithm. Users can create and customize a galaxy by adjusting parameters such as the number of stars, galaxy size, galaxy width, star velocities around the center, theta value, and smoothing length for limiting star acceleration. Additionally, users can add a black hole to the center of the galaxy and adjust its mass. The simulation also provides interactive camera controls, allowing users to rotate the camera around the galaxy using the mouse and zoom in/out using the mouse wheel.
- Galaxy Creation: Users can generate a galaxy simulation by specifying the desired number of stars, galaxy size, and galaxy width.
- Star Velocity: Users can adjust the velocity of stars around the center of the galaxy, controlling the rotation speed and direction.
- Theta Value: The simulation incorporates the Barnes-Hut algorithm, and users can customize the theta value, which affects the accuracy and performance of the algorithm.
- Smoothing Length: Users can set the smoothing length to limit the acceleration of stars, preventing unrealistic motions.
- Black Hole: The simulation allows users to add a black hole to the center of the galaxy and adjust its mass to observe its gravitational effects on nearby stars.
- Camera Controls: Users can interactively rotate the camera around the galaxy using the mouse and zoom in/out using the mouse wheel to observe the simulation from different perspectives.
- Clone the repository, download the project files or download the release.
- Open the simulation in your preferred programming environment.
- Adjust the simulation parameters, such as the number of stars, galaxy size, galaxy width, star velocities, theta value, and smoothing length.
- If desired, add a black hole to the center of the galaxy and adjust its mass.
- Run the simulation to visualize the galaxy and observe the gravitational interactions between stars.
- Use the mouse to rotate the camera around the galaxy and the mouse wheel to zoom in/out for different views.
- Modify the parameters, including star velocities and black hole mass, to observe different behaviors of the galaxy.
Contributions to this project are welcome. If you have any suggestions or would like to report an issue, please open a new issue on the project repository.
This project is licensed under the MIT- see the MIT file for details.