This is project0 code for UCBerkeley CS61B project0: NBody Simulation.
Part of the available simulations below.
Solar system, part of it.
Three body simulation.
- download this repo:
git clone https://github.com/h4x0rMadness/cs61b-proj0.git
- direct into
proj0
folder in your terminal:
cd /proj0
- make sure you have
java
installed and yourjavac
works correctly, then compileNBody
class first:
javac NBody.java
- now you can choose what you wanna simulate in
data
folder, make sure give all parameters, the standard way to callNBody
is:
java NBody arg1 arg2 arg3
where arg1
and arg2
are total simulation time and discrete simulation interval, both are of double
datatype, and arg3
is the relative path of the file you want to simulate, in this case, it should be data/somefile.txt
, for example:
java NBody 157788000.0 25000.0 data/planets.txt
- have fun!
Body
and NBody
class coded with guidance on course page, all credit to UCBerkeley cs61b.