The main program, NBody.java, draws an animation of bodies floating around in space tugging on each other with the power of gravity.
The user can control factors such as the mass, image and number of objects by altering the command when running the NBody file as well as the .txt file containing the necessary information. This results in varied and customizable simulations dictated by the user’s preferences.
The accompanying demonstration showcases just some of what is possible, and how customizable the program is.
Download the source code below.