Skip to content

NoeBrt/Galaxy-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Galaxy Simulation with GPU computing and Barnes-Hut

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.

Features

  1. Galaxy Creation: Users can generate a galaxy simulation by specifying the desired number of stars, galaxy size, and galaxy width.
  2. Star Velocity: Users can adjust the velocity of stars around the center of the galaxy, controlling the rotation speed and direction.
  3. 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.
  4. Smoothing Length: Users can set the smoothing length to limit the acceleration of stars, preventing unrealistic motions.
  5. 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.
  6. 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.

Usage

  1. Clone the repository, download the project files or download the release.
  2. Open the simulation in your preferred programming environment.
  3. Adjust the simulation parameters, such as the number of stars, galaxy size, galaxy width, star velocities, theta value, and smoothing length.
  4. If desired, add a black hole to the center of the galaxy and adjust its mass.
  5. Run the simulation to visualize the galaxy and observe the gravitational interactions between stars.
  6. Use the mouse to rotate the camera around the galaxy and the mouse wheel to zoom in/out for different views.
  7. Modify the parameters, including star velocities and black hole mass, to observe different behaviors of the galaxy.

Contribution

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.

License

This project is licensed under the MIT- see the MIT file for details.