Skip to content

Efficient n-body simulation using the barnes-hut algorithm

Notifications You must be signed in to change notification settings

iggedi-ig-ig/gravsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an implementation of the barnes-hut algorithm, which allows simulating n body systems in O(n log n) time. It also includes a a simple particle renderer for the "stars".

⚠️ Warning ⚠️

The actual algorithm is technically broken. There is a small ghost force which acts on particles in dense regions of the quad tree. This is not super obvious, and it still produces pretty pictures, which is all I really wrote it for anyways :p

Also, this is a toy project, so a lot of magic constants, etc, etc.

About

Efficient n-body simulation using the barnes-hut algorithm

Topics

Resources

Stars

Watchers

Forks