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
|