3 ms·
>Gravitational interactions between all bodies. I use an extraordinarily naive direct summation approach, which scales as O(N^2) and is horrible. A huge improve
by hexane360 9y ago
>Gravitational interactions between all bodies. I use an extraordinarily naive direct summation approach, which scales as O(N^2) and is horrible. A huge improvement would be to approximate forces from distant bodies with some kind of multipole expansion, and store masses in a balanced tree – this is known as a Barnes-Hut simulation.