Skip to content

Yet Another N-Body Simulation - An interactive n-body simulation created with Rust using Macroquad and egui.

Notifications You must be signed in to change notification settings

davegersh/ya-nbody

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet Another N-Body Simulation

Two colliding galaxies made up of 15,000 particles

An interactive n-body simulation created in Rust using Macroquad and egui.

Makes use of a (lightly) multithreaded implementation of the Barnes-Hut algorithm to effectively simulate tens of thousands of gravitational interactions between particles.

Initial conditions of the simulation are defined using TOML files, sample configs can be found in /samples. The gif above uses the config located here.

Building

First, make sure to have rust and cargo installed. If not, instructions can be found here.

Next, simply clone this repo to a desired location, and run the following command:

cargo run --release [example.toml]

Replace [example.toml] with the path to your own toml config file.

NixOS

Before using the command above, make use of the shell.nix file by running:

nix-shell

This starts a development environment where Ya-nbody can be built and run.

About

Yet Another N-Body Simulation - An interactive n-body simulation created with Rust using Macroquad and egui.

Topics

Resources

Stars

Watchers

Forks