< previous page page_163 next page >

Page 163
6.2.3.1.2.2.5
easter_julian_meeus ()
This Julian Easter routine (Listing 6.18) is given by Jean Meeus in his book Astronomical Algorithms. It assumes a valid date range of A.D. 1 to 1582.
(continued)
Listing 6.16
if (n > 31)
      {
      date.month = 4;
      date.day = (n - 31);
      }
   else
      {
      date.month = 3;
      date.day = n;
      }


   date.year = year;


   return (date);
}

Listing 6.17 easter_gregorian_meeus ()
/* eastergm.c
   +-------------------------------------------+
   |   Copyright (C) 1995 by Lance W. Latham.  |
   |         All rights reserved.              |
   +-------------------------------------------+


   INPUTS:
   1. year, type int, the year in the Gregorian calendar for which the
      date of Easter is desired. Valid values are 1583 to INT_MAX.


   OUTPUTS:
   1. Returned by routine, a DATE_INFO structure containing the date of
      Easter for the given year.


   NOTES:
   1. This Gregorian Easter routine is given by Jean Meeus in his book, "Astronomical
   Algorithms", Willmann-Bell, Inc., Richmond, VA, 1991, ISBN 0-943396-35-2, pages 67-68.


   Meeus states that the routine is given by Spencer Jones in "General Astronomy",
   pages 7374 of the 1922 edition. Meeus further notes that the routine was
   published again in the Journal of the British Astronomical Association, volume
   88, page 91, December 1977, where it it is stated that the method was devised
   in 1876, and appeared in Butcher, "Ecclesiastical Calendar".


   Meeus states that the routine is valid for all Gregorian years, i.e., year > 1582.


   2. The routine returns a date of all zeroes for invalid years, i.e., year < 1583.
      No other validation is performed, and no warning is issued in this case.
*/

 
< previous page page_163 next page >