Gravitation

SolOne weekend, about a month ago, I threw together a quick simulation of the solar system because I was studying gravitation in school. Since I have some time now I went back and polished it to allow user interaction and remove various glitches. It’s still quite crude, but I’m done dealing with it, so I figured that I’d throw it up here. One of the coolest things it does (IMO) is show the paths of the planets from a non-heliocentric viewpoint.

Everything (code and images) is public domain. Credit is nice, but not necessary. Download code (and runnable jar) here. Created using Slick (Build #266) with LWJGL (2.0b1).

Geocentric Perspective
A Geocentric View of the Universe.

Geocentric Perspective 2
Another Geocentric Perspective.

Jupiter Perspective
View from Jupiter.

Oh, and I almost forgot! One of the other neat things I did with the simulation was “experimentally” measure the speeds of the planets (except Neptune). I looked up average orbital distances and the mass of the sun on Wikipedia and then tweaked the initial velocity of each planet until the orbit looked roughly circular. I did this mostly out of laziness, but I was shocked at how close I had gotten to the real values.

Estimated Speed (km/s) Observed Speed (Average) (km/s)
Mercury 48 47.87
Venus 34.5 35.02
Earth 29.5 29.783
Moon 30.5 30.805
= 29.783 (earth) + 1.022 (relative speed of luna)
Mars 24 24.077
Jupiter 13 13.07
Saturn 9.5 9.69
Uranus 6.8 6.81
This entry was posted in Code and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. anne
    Posted December 5, 2009 at 5:01 pm | Permalink

    COOOOOOL!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>