(Comp.sys.handhelds) Item: 581 by gerson at parc.xerox.com Author: [Dan Gerson] Subj: More accurate phase of the moon program Date: Thu Jul 12 1990 07:02 Here is an improved program to calculate and display the phase of the moon. It uses the drawing routines provided by Craig Finseth's phase of the moon program (with the modifications to FLIP as suggested by Preston Brown and Juri Munkki), but has an adapted version of the very complicated phase calcuation in John Walker's moontool application on the SUN. The HP48SX results are exactly the same as those obtained from Moontool, which appear to be extremely accurate, unlike the previous moon phase program. To use it, you have to write out your current time difference from UTC in a TMZN global variable somewhere; I have my system setup with TMZN stored in { HOME } so it is available to other programs I use. Otherwise, you can just put it in the same directory as your put { JDAT }. For example, the correct value for California is currently 7. [Note: I put TMZN in the MOON2 directory on the disk. No need to worry about it. Just be sure to store your "time zone" UTC offset into it; default is 7. -jkh-] Then {MPHASE} displays the current phase of the moon graphically using Craig Finseth's code, {MTIME} returns a string containing the number of days, hours, and minutes from the last new moon along with the current percentage of the moon which is illuminated, {MFRAC} returns the illuminated percentage to level 2 and the percentage of the moon's age since the last new moon in level 1, and finally, {JDAT} return the current civil julian date and fraction of the day (UTC). ---------------- (Comp.sys.handhelds) Item: 598 by gerson at parc.xerox.com Author: [Dan Gerson] Subj: Error in moon phase posting [already fixed -jkh-] Date: Tue Jul 17 1990 07:02 My previous posting had a bug which was sensitive to the phase of the moon. In my zealous attempts to inline a function, I messed up at the end of 'MFRAC'; where it says 360 /, it should read 360 MOD 360 /. I'll post the completely corrected entry later. [Don't worry about it!!! Already fixed. -jkh-]