Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mandarancio/nbodies
- Owner: Mandarancio
- License: bsd-3-clause
- Created: 2017-06-12T13:58:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-28T13:39:43.000Z (about 7 years ago)
- Last Synced: 2025-01-20T02:22:24.611Z (15 days ago)
- Topics: body-simulation, haskell, haskell-learning, sdl, sdl2, simulation
- Language: Haskell
- Size: 11.5 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
```