View Single Post
  #4  
Old 12-09-2008, 04:16 PM
Wavytone
Registered User

Wavytone is offline
 
Join Date: Jul 2008
Location: Killara, Sydney
Posts: 4,147
Quote:
Originally Posted by stephend View Post
I want to write a program to calculate moonrise and phase, so that this can be displayed in a website automatically far into the future.
This site http://www.ngc7000.org/astrotools/astrotools.html has what you want in Javascript, save the page and view as source.

One source is Jan Meeus' book as pointed out previously, there are also 2-3 books by Peter Duffett-Smith with a similar method which from memory can be made recursive if you want high precision though it will be within 1 minute on the first pass and 1 second on the second.

For most purposes you don't really need precision better than the nearest minute given the size of the moon, refraction and the (unknown) users horizon, so forget all the perturbation terms and just stick to the first order orbit and do the calculation for a geocentric observer (ie don't correct for parallax either). It's straightforward with the Duffett-Smith method, I implemented this in my HP41CX 25 years ago for calculating the ASNSW ephemerides of sun moon and planets.

However there are plenty of sites with this data already (and much more), I'd suggest link to one of the credible ones that is likely to be around for a long time.

Last edited by Wavytone; 14-09-2008 at 08:34 AM.
Reply With Quote