Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mandarancio/nbodies

Haskell SDL2 , N Body simulation
https://github.com/mandarancio/nbodies

body-simulation haskell haskell-learning sdl sdl2 simulation

Last synced: 7 days ago
JSON representation

Haskell SDL2 , N Body simulation

Awesome Lists containing this project

README

        

# nbodies

Siple N Body simulation in Haskell (rendered using SDL2)

**Have fun ;)**

![Demo](docs/demo.gif)

## Setup and run

```bash
stack build
stack exec nbodies config/cfg.yml
```

## Configuration
The configuration is a Yaml file and has this structure:

```yaml
--- # Configuration
qtree: true # display Quad Tree
barnesHut: true # enable/disable Barnes Hut simulation
g: 1 # universal gravitational constant
dT: 0.2 # time interval of the simulation
scale: 1 # simulation scale (0: auto)
bodies: # list of bodies
- pos: {x: 0., y: 0.} # position
mass: 100. # mass
mom: {x: 0., y: 0.} # momentum (speed)
```