The purpose of this assignment was to create a solar system simulation. This assignment was separated in two parts. In the first part we needed to create a program that loads and displays a static universe. The assignment used a given file which contained everything needed for the universe (the planets). The assignment called to be able to have the planets in a linear order and to have the positions printed on the console. In the second part of this assignment the goal was to add physics to the simulation. In order to do that we needed to implement a few equations which included: pairwise force, acceleration and velocity.
What I accomplished from this assignment was I created a universe that began in a linear formation. The assignment soon later became a full on working solar system that rotated around the sun. I was also able to get the position of each planet printed to the console.
The key algorithm used was a mix of sorting and finding the min/ max. Sorting was somewhat used when figuring out how to get planets from the file to the window. Finding the min/max was also used because if you didn’t implement the equations correctly the planets would rotate incorrectly.
This assignment used a stack data structure. In the first part of the assignment we needed to create the planets in a linear path. First, initialing the sun into the center of the window, which would then make it easier to figure out the placement for the other planets.
