Skip to content

This Java Application is a rendering of the orbits of the planets in our own solar system

Notifications You must be signed in to change notification settings

jdiedrich02/Solar-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Solar System Animation

Take a journey through our Solar System!! The cosmos is a really cool subject to study, especially our solar system which is where our little blue planet that houses all of us humans!

This animation of the solar system uses the orbits of the planets to show how each planet rotates around our sun!

Tech

I decided to use Java for this project (specifically Java Swing) because I want to learn how to create a cool project in a variety of different programming languages! This is used to create a new window where we have some circles that rotate around a bigger circle (SO COOL). I actually was interested in how computers were able to generate images of a Black Hole, so I asked ChatGPT how they did this. It responded back with some code showing an orbit. This is when the idea hit me to make a solar system animation instead. I built on what ChatGPT gave me by adding all of the planets and calculating the specific orbits, as well as other additions for completed orbits, etc.

This project has the 7 planets of our solar system (sorry pluto :( ) that rotate around our sun. The rotation speeds are calculated based on the amount of days it takes for the planet to make a full rotation around our sun.

There is a timer above that shows the full time elapsed when the planets are moving and a button to start or stop the orbits from moving.

  • Mercury -> 88 days
  • Venus -> 225 days
  • Earth -> 365 days
  • Mars -> 687 days
  • Jupiter -> 12 years
  • Saturn -> 29 years
  • Uranus -> 84 years
  • Neptune -> 165 years

Earth is our starting point, so it rotates around at a nice round number.

I am hoping this tool can help some people. Even though it's super simple, it still can be useful! Hopefully with the total time elapsed with the orbits as well as logs that show the amount of orbits completed by each planet, maybe some theories and some orbit alignments can be predicted and found with this application!

Ofcouse this app I made for fun because I love space, but it is cool to think of what can be found using it.

How It Works

For this project I was using Java version 15.0.1 from 2020-10-20. Make sure to have Java installed. You can find the list of downloads here: https://www.oracle.com/java/technologies/downloads/

In my personal environment, I was using VS Code and running the program from there. This project uses Java Swing as well as Java AWT. When running it from VS Code, it handled all of the imports and installs from there. Using the terminal, it might be a little different.

Once it is up and running enjoy the view of our solar system!!

Possible Additions

  • In the Future, I would like to add support for placing the circles at a specific start point. Right now they are all aligned when first initialized which can be troublesome. Hopefully I will add this in the near future.
  • I would also like to add a settings tab feature, this will help with the intial starting positions. Here as well I want to add a feature for the user to add a Earth speed integer. This way the orbits (mostly for the outer planets) can be a bit faster. This will make it easier for observations.

Any feedback is greatly appreciated, if there is an issue or feature that might seem cool to add please create an issue!

About

This Java Application is a rendering of the orbits of the planets in our own solar system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages