sexta-feira, abril 06, 2012

How to calculate the date of Easter?


To calculate the date of Easter for any year in the Gregorian calendar (the calendar in Brazil), use the following formula, with all integer variables, with the waste division signored. It is used y for year, m for month and d for days. The sign * denotes multiplication.

c = y/100
n = y - * 19 (y/19)
k = (c - 17) / 25
c = i - c / 4 - (c-k) / n + 3 * 15 +19
i = i - 30 * (i/30)
i = i - (i/28) * (1 - (i/28) * (29 / (i +1)) * ((21-n) / 11))
j = y + y / 4 + i + c + c-2/4
j = j - 7 * (j / 7)
l = i - j
m = 3 + (l +40) / 44
+ d = 28-31 * (m / 4)

For example, for the year 2000,

y = 2000
c = 2000/100 = 20
2000-19 = n × (2000/19) = 2000-19 = 105 × 5
k = (20-17) / 25 = 0
i = 20 - (20/4) - [(20-0) / 3] + (19 × 5) +15 = 20-5-6 +95 +15 = 119
i = 119-30 × (119/30) = 119 - (30 × 3) = 29
i = 29 - {(29/28) × [1 - (29/28)] × (29/30) × [(21-5) / 11] = 29} - {1 × 1 × 0 × 0} = 29
j = 2000 +500 +29 +2-20 +5 = 2516
j = 2516 - [7 × (2516/7)] = 2516 - [7 × 359] = 3
l = 29-3 = 26
m = 3 + [(26 +40) / 44] = 3 +1 = 4
d = 26 +28- (1 × 31) = 23

with Easter on April 23, 2000.



By: JNMarcos