Google Answers Logo
View Question
 
Q: Calculating lunar cycles ( No Answer,   1 Comment )
Question  
Subject: Calculating lunar cycles
Category: Science > Astronomy
Asked by: cyberjim-ga
List Price: $30.00
Posted: 07 Sep 2003 14:31 PDT
Expires: 13 Sep 2003 20:02 PDT
Question ID: 253252
Can you point me to an algorithm that, given a JDN (Julian Day Number)
in the Julian Day Cycle 4713 BC through 3268 AD, will correctly
calculate the lunar phase for that date?

The result of the algorithm could be an integer or real number that
represents the lunar phase.  Example: the integers 0 through 3 could
be used to represent the New Moon, First Quarter, Full Moon and Last
Quarter, respectively.

The algorithm will be deemed correct if it produces results consistent
with known lunar phases throughout the Julian Day Cycle.

Request for Question Clarification by bikerman-ga on 07 Sep 2003 14:44 PDT
Hi, cyberjim-ga,

Is there a specific programming language you would prefer the
algorithm to be in?  Or are you looking for a pseudo-code algorithm?

Thanks,
bikerman

Clarification of Question by cyberjim-ga on 07 Sep 2003 16:14 PDT
I intend to incorporate said agorithm in a C program, so I would
accept C source.  I suppose it could be in BASIC, as I could easily
convert it into C.  But it could also be in the form of a math's
algorithm - that's why I just specified an 'algorithm'.

Clarification of Question by cyberjim-ga on 07 Sep 2003 16:44 PDT
Oh - and a pseudo-code algorithm would be great!

Request for Question Clarification by hlabadie-ga on 13 Sep 2003 14:28 PDT
I have found the source for a Java applet that performs calculations
of lunar phases for dates between 3999 BC and AD 3999, and a
JavaScript program that seems to cover the range desired. Would those,
the limited C source, and the pointer to the book suffice?

hlabadie-ga

Clarification of Question by cyberjim-ga on 13 Sep 2003 20:01 PDT
hlabadie-ga,

Thank you for your diligence!

I had decided to close this question when I got home, only to find that
you are ready with an answer.  Now I have a tough decision.

First of all, (maybe I should have pointed this out in my original post)
I have Jean Meeus' "Astronomical Algorithms". It is excellent, but it
does not go back nearly far enough.  And I have lots of Algorithms in C
and BASIC but, again, they don't come close to spanning the entire Julian
Cycle.

Secondly, I have no experience with Java - though I have heard it's
similar to C.  If weren't for the above and what follows, I would
likely take a chance on it.

But lastly, I've decided to follow-up on a coulple of tips I got in the
sci.astro group on Usenet earlier today.  My feeling is, it's a safer
bet than the Java script.  But then again, I may be chasing the wild
goose. :)

But in that case, I could re-open my question here and ask for you to
answer it.

For these reasons, I have decided to close this question for now.


Till next,
cyberjim-ga
Answer  
There is no answer at this time.

Comments  
Subject: Re: Calculating lunar cycles
From: hlabadie-ga on 08 Sep 2003 04:56 PDT
 
There are C routines online that make calculations from 1975 onward,
but none that I have found that go back as far as you would like.
However, the online algorithms, and most computer astronomical
programs, are all based on Astronomical Algorithms by Jan Meeus.

http://www.willbell.com/math/mc1.htm

hlabadie-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy