Solar System graphical Simulator using Processing

This is a graphics project that shows the motion of all the planets of the solar system, and Pluto in their orbits. It shows the correct relative scale of elliptical orbits of the planet with the Sun at one of its focus. A planet, while orbiting around the sun, sweeps out an equal distance in equal interval of time. The square of the time to orbit a planet is proportional to its distance from the Sun. These are the three Keplerian laws of planetary motion, which the project satisfies. Despite these, the actual code of the project is short and easy to understand.


To run the project, you need to download Processing for your platform from here and then open the Processing IDE. Processing is built atop Java, and unlike the legacy Applet system of Java, it is faster, more efficient and easier to learn.

Copy and paste the following code into the Processing IDE and run (by clicking the PLAY button or by pressing CTRL+R) the project. You should have the project running on your screen.

WARNING: The control shown in the above video has changed.

The new controls are –

  • W/S – Rotate along X-axis
  • A/D – Rotate along Y-axis
  • Q/E – Rotate along Z-axis
  • UP arrow – Zoom In
  • DOWN arrow – Zoom Out
  • O – Toggle orbit display
  • 0 – Focus on the Sun
  • 1-9 – Focus on the nine planets (and dwarf planet)
  • M – Speed up time
  • N – Slow down time