Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2006

Tip: Looking for answers? Try searching our database.

Thanks (What's the best...)

Thread view: 
Ernie Wright - 04 Mar 2006 17:21 GMT
A few weeks ago I asked a somewhat philosophical question about the best
way to structure a certain coordinate conversion and got a lot of help
with it.

   http://groups.google.com/group/comp.lang.java.help/msg/dcd06182643c1866

As it turned out, I used a combination of approaches.  I have a SkyPos
class that stores astronomical and screen coordinates and converts from
one to the other, but the method that performs the transformation calls
a number of static methods in a utility class that take 'double[] from'
and 'double[] to' arguments.

If anyone's curious, the resulting applet is on my site,

   http://home.comcast.net/~erniew/astro/plani.html

- Ernie                                  http://home.comcast.net/~erniew
Roedy Green - 04 Mar 2006 20:55 GMT
>    http://home.comcast.net/~erniew/astro/plani.html

back in the 70s I wrote a program to predict the positions of the
planets and the moon using the principles of spherical astronomy.

It would match published ephemerises for several years into the future
but would wander after that.  The essential problem was any error
compounded itself over time.

I may have had only 32-bit floats. I don't remember now. I did not
have the navy's polynomials. It was all on punch cards in FORTRAN.

I wondered if you had any idea of how accurate your algorithms are
over time.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Ernie Wright - 05 Mar 2006 08:16 GMT
> back in the 70s I wrote a program to predict the positions of the
> planets and the moon using the principles of spherical astronomy.
>
> It would match published ephemerises for several years into the future
> but would wander after that.  The essential problem was any error
> compounded itself over time.

If the calculation was incremental (used previous results to find the
new one), it would indeed start to wander due to roundoff, particularly
if you were using 32-bit floats.  Another possibility is precession,
which slowly rotates the equatorial coordinate frame--you might have
just been seeing mismatched epochs rather than position errors.

> It was all on punch cards in FORTRAN.

Youngsters don't know what it's like to carry their programs around in
a shoe box.

> I wondered if you had any idea of how accurate your algorithms are
> over time.

The accuracy of the methods I used is discussed in some of the sources I
mentioned on the webpage.  A good online source is

   http://ssd.jpl.nasa.gov/?planet_pos

The error numbers are the maximum error you'd expect.  If you graph the
error over time, it's usually much lower, but periodically spikes to the
levels listed in this table.

I spot-checked my applet against a full VSOP87 calculation for Mars and
Saturn at several dates between 1950 and 2050 to make sure I was in the
right ballpark.  The errors were between a couple of arcseconds and an
arcminute.  The Moon is a lot messier, but the source of the method I
used claims an error of about 5 minutes in r.a. and 1 arcminute in dec.

All respectable considering how small the code is, and all smaller than
a single pixel in the applet's display, so I get the same plot I would
have gotten from a more accurate and expensive calculation.

- Ernie                                  http://home.comcast.net/~erniew
Roedy Green - 05 Mar 2006 15:11 GMT
>All respectable considering how small the code is, and all smaller than
>a single pixel in the applet's display, so I get the same plot I would
>have gotten from a more accurate and expensive calculation.

You did a beautiful job. The code is fast too.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Ernie Wright - 05 Mar 2006 21:01 GMT
> You did a beautiful job. The code is fast too.

Thanks Roedy.

- Ernie                                  http://home.comcast.net/~erniew
IchBin - 05 Mar 2006 02:33 GMT
> A few weeks ago I asked a somewhat philosophical question about the best
> way to structure a certain coordinate conversion and got a lot of help
[quoted text clipped - 13 lines]
>
> - Ernie                                  http://home.comcast.net/~erniew

Beautiful site Ernie...

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)
Ernie Wright - 05 Mar 2006 08:17 GMT
> Beautiful site Ernie...

Thanks!

- Ernie                                  http://home.comcast.net/~erniew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.