<space>: Switch algorithms <click>: Place particles <v>: Switch visualizations (Barnes-Hut only) An approximate (and probably buggy) gravity simulation using a 2D variant of the Barnes-Hut algorithm. 200 particles are simulated here. The performance is not very good, but it's much faster than brute-force. The algorithm constructs a data structure that lets us approximate forces from groups of distant particles as single masses.