On Thu, 20 May 2004 22:30:33 -0400, Behdad Esfahbod <[EMAIL PROTECTED]> wrote: > > On Thu, 20 May 2004, Ordak D. Coward wrote: > > > Ordak's 2820 year method: > > bool isLeap2820ODC = ((683*year+542) % 2820) < 683; > > > > in comparison to: > > > > Birashk's 2820 year method: > > bool isLeap2820Birashk = ((year % 2820) == 474) || > > (((31 * ((year+2345) % 2820)) % 128) > 96); > > I second that. Here is my version, in a desktop calculator > friendly (and macrowize side-effect-less) way: > > #define is_persian_leap(y) ((((y)-474)%2820+2820)%2820*31%128<31)
Nice. > > > > The discrepancies will be in: > > years that Ordak considers leap but not Birashk > > 603, 731, 859, 1787, 1915, 2043, 2171, 2299, 2427, 2460, 2555, 2588, > > 2683, 2716, 2811, 2844, 2939, 2972, 3067, 3100, 3133, 3195, 3228, > > 3261, 3295 > > > > and > > years that Birashk considers leap but not Ordak > > 602, 730, 858, 1788, 1916, 2044, 2172, 2300, 2428, 2461, 2556, 2589, > > 2684, 2717, 2812, 2845, 2940, 2973, 3068, 3101, 3134, 3196, 3229, > > 3262, 3294 > > > > Caveat: > > According to: > > http://scienceworld.wolfram.com/astronomy/TropicalYear.html > > The length of year is decreasing each year. According to graphs in > > http://www.angelfire.com/dc2/calendrics/ > > The real length of vernal equinox year (Iranian year) is increasing > > each year (from 351 BC to 3175 A.D.) According to Iranian tradition, > > vernal equinox should happen before noon (I think it means > > astronomical noon). So, there is not much we can do with simple > > algorithms other than trying to approximate the real world, and > > understanding the fact that ALL calendar algorithms are only > > APPROXIMATIONS. > > > > -- > > ODC > > Well, so what do you suggest? Working on an approximate > astronomical algorithm or go with Birashk's? > I guess the best thing to do: - is get an archive of the last 50 years of official times of vernal equinox, or saal tahveel, and compute the length of year for each year. Fit them with linear or quadratic curves. Look at Birashk's method and see how much Birashk's length of year differs from official length of year. Also, look at the real variation of length of years, compute the calendar for the next 1000 years using both Birashk and the curves. Decide if using the curves will result in less error. Here is an attempt to guesstimate when the official calendar starts to diverge from Birashk's. A rough look at the last few years variation of length of years show a variation of up to 5 minutes. So, each 144 years or so (24hours / 10 minutes) , we have a year whose VE is +/- 5 minutes of noon. Hence, as long as we use a constant for the length of year, it is very likely to see discrepancies once every 144 years. However, this WILL happen as early as 1404. That is, if my calculations are correct Birashk's method gives year 1404 as a leap year, but I get 1403 as a leap year. (I am using some acceptable length of years). That is, the VE of year 1404 should happen around 12:30pm which if it considered afternoon, it shall be Esfand 30th of 1403. THIS IS IMPORTANT AND SHOULD BE DEALT WITH. No amount of observational errors can compensate this. Considering the computational power available today, it is a shame if we stick to a method using constant length of year which were only appropriate for pre-computer era. -- ODC _______________________________________________ PersianComputing mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/persiancomputing