Moon Phase Dates

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math topics]   [Library]   [Utilities]

 

Search

Search WWW

Search DelphiForFun.org

As of October, 2016, Embarcadero is offering a free release of Delphi (Delphi 10.1 Berlin Starter Edition ).     There are a few restrictions, but it is a welcome step toward making more programmers aware of the joys of Delphi.  They do say "Offer may be withdrawn at any time", so don't delay if you want to check it out.  Please use the feedback link to let me know if the link stops working.

 

Support DFF - Shop

 If you shop at Amazon anyway,  consider using this link. We receive a few cents from each purchase.   Thanks.


Support DFF - Donate

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

Search DelphiForFun.org only

 

 

Problem Description

Here's a  program that calculates the dates and times of new and full moons for any given start date and number of months.    

Background & Techniques

The moon travels around the earth about once every 29 1/2 days.  (Actually about once every 27 1/2 days but it seems like 29 1/2 to us for reasons we'll explore in a moment.)    It's path around the earth is tilted approximately 5 degrees from plane of the earth's orbit about the sun.   This means that when the moon is on the far side of the earth, away from the sun, then we are looking directly away from the sun as we view the moon and the full disk is lit up (a full moon).  Half a revolution later, the moon is between us and the sun and the side facing us is not illuminated at all  (a new moon).   This also explains why the full moon shines nearly all night - just about the time we turn away from the sun (sunset), the moon is just coming into view.   Similarly,  the new moon rises and sets at about the same time as the sun.   

Now about the 27.5 day to  29.5 day cycle discrepancy.  The moon happens to rotate around the earth in the same direction as the earth rotates about the sun.   This means that  27.5 days after, say a full moon, the moon has made a full circuit of the earth, but the earth has moved forward about 27.5/ 365  (=.075) of its circuit about the sun so the moon is lagging behind where it needs to be in order to appear directly opposite the earth    In fact the moon will have to make up about .075 of its circuit to again be directly away from the sun.  This will take .075x27.5 or 2.1 days,  making the apparent  lunar cycle about 29.6 days! 

By the way,  the same reasoning explains why while days seem to be 24 hours long and years average  365.25 days,  alien observers from outer space would  see that we actually take only about 23 hours and 56 minutes to rotate 360 degrees and that we actually make   366.25 revolutions on our axis per circuit of the sun!      

Programmer's Notes

The actual calculation of dates of the new and full moons is based on Basic code I converted from Peter Duffett-Smith's book "Astronomy with your Personal Computer",  Cambridge University Press, 1990.   Duffett-Smith, in turn, attributes the routine to Meuss's book "Astronomical Formulae for Calculators"

Moon calculations, like all planetary calculations, tend to be messy because of the effect of gravity which is always speeding things up, or slowing them down.  And since the earth's orbit is elliptical about  the sun, the amount of speeding up/slowing down also varies depending on our  distance from the sun.   The approximations in this program calculate the time of the new and full moons within 2 minutes.   Duffet-Smith's more accurate "Moon" subroutine calculates the position of the moon within a few arc-seconds, but uses  "the first 53 terms in longitude, 47 in latitude, and 31 in horizontal parallax" of the harmonic series used to represent the position of the moon as a function of time.    Now that's messy!

 

Running/Exploring the Program 

Suggestions for Further Explorations

Duffet-Smith's book referenced above has an extensive set of subroutines and test programs written in Basic.  Conversion of these into an Delphi "TAstronomy" unit would occupy one's spare time  for a few weeks.   (I know, because I've done it - but documenting it is a task that would not be nearly as much fun!)  

 

Original Date: March 23, 2003 

Modified: February 18, 2016

 
  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright 2000-2017, Gary Darby    All rights reserved.