Skip to content

okayzed/nbody.love

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

an n-body gravity simulator written in lua with the love2d framework

keyboard shortcuts

  • 1: random body placement
  • 2: show solar system
  • 3: use nbody presets
  • space / backspace: focus next / prev body
  • f: float camera
  • r: reset canvas
  • c: restart current simulation
  • m: toggle drawing trajectories
  • s: take a screenshot
  • b and n: prev / next nbody simulation
  • - and + : zoom out / in
  • . and ,: slow down / speed up simulation
  • d and D: decrease / increase time step
  • [ and ]: pick prev / next integrator
  • p: print body info (mass, area, velocity) to terminal

Integrators

  • euler / semi-implicit euler
  • verlet

Sources

Planetary data is obtained from the astro-phys.com API

closed nbody orbits are from www.princeton.edu/~rvdb/WebGL/nBody.html

more GIFs

About

nbody simulation in love2d

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published