/nbody-2d

A simple N-body simulation implementing Newtonian gravity on a 2D field of dynamically colored particles.

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

gravity-particles

A simple N-body simulation implementing Newtonian gravity on a 2D field of dynamically colored particles.

To Compile

javac ParticleDisplay.java
java ParticleDisplay.java

Usage

Left Mouse Button - toggles attraction towards cursor.
Right Mouse Button - places a static gravity point that particles are attracted to.
Delete - removes all gravity points.
R - resets all particles to their initial positions.
Enter - sets velocity of all particles to 0, but keeps them in the same spot.
Space Bar - pauses the simulation.
Esc - closes the program.

License

GNU GPLv3