| README | planet.cc | gnu | sun | all.zip |
planet.cc is a worked solution for the task:
x += v * dt;and v += a * dt;Such human-friendly statements are not possible in many older languages such as C. In the class approach to the particle, all the functions associated with the particle are put within the definition of the particle. The program writes the trajectory to stdout, so the intended usage is something like: planet > tmpThe printout contains For example gnuplot load 'gnu'
gnu is a simple gnuplot file for plotting the output of planet.cc. It displays the positions and the velocities in a single graph. The file sun contains the coordinates of the sun | ||||