From: Daniel noSpam at daik dot on
Hello all,
I'm looking for a library to draw the orbits of all planets, dwarf
planets and moons in the solar system. I'm looking for this for a game
project, so it does not need to be 100% accurate but it needs to be
close. Even if the library can "only" draw the planets I am
interested. Does anyone know of any good libraries to do this? This is
for an open source project so the license needs to be compatible with
open source projects.

regards
Daniel
From: Eric Sosman on
On 6/19/2010 7:26 AM, Daniel wrote:
> Hello all,
> I'm looking for a library to draw the orbits of all planets, dwarf
> planets and moons in the solar system. I'm looking for this for a game
> project, so it does not need to be 100% accurate but it needs to be
> close. Even if the library can "only" draw the planets I am
> interested. Does anyone know of any good libraries to do this? This is
> for an open source project so the license needs to be compatible with
> open source projects.

Just draw ellipses. The difference between an ellipse and the
planet's true lumpy-bumpy path will be too small to see at the coarse
resolution of a computer screen.

For that matter, most moons will be indistinguishable from the
planets they circle. Let's see: Neptune's mean distance from the Sun
is 2.8 billion miles, so a display of the full orbit must span a
scaled distance of 5.6 billion miles. If the screen is 2000 pixels
across, each pixel represents somewhat more than 2.8 million miles.
Neptune's most distant known moon, Neso, is about 30 million miles
from the planet, not quite eleven pixels. The innermost seven moons
are all less than one-eighth of a pixel away, so they'll display
right on top of Neptune itself.

--
Eric Sosman
esosman(a)ieee-dot-org.invalid
From: Lew on
Daniel wrote:
>> I'm looking for a library to draw the orbits of all planets, dwarf
>> planets and moons in the solar system. I'm looking for this for a game
>> project, so it does not need to be 100% accurate but it needs to be
>> close. Even if the library can "only" draw the planets I am

Why did you put "only" in quotes?

>> interested. Does anyone know of any good libraries to do this? This is
>> for an open source project so the license needs to be compatible with
>> open source projects.

Eric Sosman wrote:
> Just draw ellipses. The difference between an ellipse and the
> planet's true lumpy-bumpy path will be too small to see at the coarse
> resolution of a computer screen.
>
> For that matter, most moons will be indistinguishable from the
> planets they circle. Let's see: Neptune's mean distance from the Sun
> is 2.8 billion miles, so a display of the full orbit must span a
> scaled distance of 5.6 billion miles. If the screen is 2000 pixels
> across, each pixel represents somewhat more than 2.8 million miles.
> Neptune's most distant known moon, Neso, is about 30 million miles
> from the planet, not quite eleven pixels. The innermost seven moons
> are all less than one-eighth of a pixel away, so they'll display
> right on top of Neptune itself.

At the scale that shows Neptune, Mercury's orbit on your hypothetical screen
similarly would vary from, oh, ten to nineteen pixels from the Sun. Half that
if you want to show the Kuiper belt.

Googling found me this:
http://csep10.phys.utk.edu/astr161/lect/solarsys/planet_orbits.gif

You did Google for this, right? I got a ton of likely-looking hits from
<http://www.google.com/search?q=planetary+orbits+Java+draw+open+source>

--
Lew
From: Eric Sosman on
On 6/19/2010 9:43 AM, Lew wrote:
> Daniel wrote:
>>> I'm looking for a library to draw the orbits of all planets, dwarf
>>> planets and moons in the solar system. I'm looking for this for a game
>>> project, so it does not need to be 100% accurate but it needs to be
>>> close. Even if the library can "only" draw the planets I am
>
> Why did you put "only" in quotes?
>
>>> interested. Does anyone know of any good libraries to do this? This is
>>> for an open source project so the license needs to be compatible with
>>> open source projects.
>
> Eric Sosman wrote:
>> Just draw ellipses. The difference between an ellipse and the
>> planet's true lumpy-bumpy path will be too small to see at the coarse
>> resolution of a computer screen.
>>
>> For that matter, most moons will be indistinguishable from the
>> planets they circle. Let's see: Neptune's mean distance from the Sun
>> is 2.8 billion miles, so a display of the full orbit must span a
>> scaled distance of 5.6 billion miles. If the screen is 2000 pixels
>> across, each pixel represents somewhat more than 2.8 million miles.
>> Neptune's most distant known moon, Neso, is about 30 million miles
>> from the planet, not quite eleven pixels. The innermost seven moons
>> are all less than one-eighth of a pixel away, so they'll display
>> right on top of Neptune itself.
>
> At the scale that shows Neptune, Mercury's orbit on your hypothetical
> screen similarly would vary from, oh, ten to nineteen pixels from the
> Sun. Half that if you want to show the Kuiper belt.

And Luna would be about one-tenth of a pixel from Terra, which
may be all right because Terra itself is only 0.003 pixels across.
And you don't even want to think about Phobos ...

The point of all this scale-mongering is to get the O.P. to
think about what he's trying to do. A true-scale view of the
Solar system on a screen whose resolution can't be finer than 0.05%
is just not going to show the sort of detail he mentions, and is not
going to look very good in his game. He's going to have to change
his, er, viewpoint in some way to get anywhere. Two possibilities:

- Don't try to show the entire Solar system all at once, but
zoom in on the region where Captain Zoom is battling the
Underlings of the Overlord. Focus on Neptune itself and let
the Sun drift far off-screen, and you'll be able to scale up
to the point where things start to become visible.

- Cheat. Show the entire Solar system, but selectively magnify
some distances and shrink others to make a pretty picture.
Make Terra the size of six Jupiters, drag Neptune in to about
Mars' orbit, let the space ships travel at a hundred c or so,
that sort of thing.

.... and surely there are other approaches a game writer might employ.

Google found <http://www.phrenopolis.com/perspective/solarsystem/>
for me, a page that displays a to-scale rendering of the Solar system
with the Sun shrunken from its normal 800,000 miles down to about six
inches. As the page's text points out, "That makes this page rather
large - on an ordinary 72 dpi monitor it's just over half a mile wide."
Use a steady hand on the scroll bar ...

--
Eric Sosman
esosman(a)ieee-dot-org.invalid
From: Roedy Green on
On Sat, 19 Jun 2010 21:26:09 +1000, Daniel <noSpam at daik dot se>
wrote, quoted or indirectly quoted someone who said :

>I'm looking for a library to draw the orbits of all planets

Would not just a simple ellipse do?

java.awt.geom
--
Roedy Green Canadian Mind Products
http://mindprod.com

There is no harm in being sometimes wrong especially if one is promptly found out.
~ John Maynard Keynes (born: 1883-06-05 died: 1946-04-21 at age: 62)