Created
July 18, 2011 15:20
-
-
Save trivektor/1089840 to your computer and use it in GitHub Desktop.
How to calculate Easter Sunday
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# created by Nathan Broadbent (http://madebynathan.com/2011/03/31/thanks-first-council-of-nicaea/) | |
def easter(year) | |
c=year/100 | |
n=year-19*(year/19) | |
k=(c-17)/25 | |
i=c-c/4-(c-k)/3+19*n+15 | |
i-=30*(i/30) | |
i-=(i/28)*(1 -(i/28)*(29/(i+1))*((21-n)/11)) | |
j=year+year/4+i+2-c+c/4 | |
j-=7*(j/7) | |
l=i-j | |
month=3+(l+40)/44 | |
day=l+28-31*(month/4) | |
[day, month] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment