2013년 9월 2일 월요일

[예전글 스크랩] [본문스크랩] 부활절 날짜 계산


[본문스크랩] 부활절 날짜 계산  나의 관심정보 
2008/06/07 00:08  수정  삭제
작성자: fftkrr
출처 Momorian Bay | 모모
원문 http://blog.naver.com/lpsc3/130003717351

부활절은 춘분후 보름이 후 첫 주이다.

 이에 따라 매년 날짜가 달라진다.

아래는 계산식이 있는 곳의 원문을 실었다.

http://aa.usno.navy.mil/faq/docs/easter.html

Computing the Date of Easter

The rule is that Easter is the first Sunday after the first ecclesiastical full moon that occurs on or after March 21. The lunar cycles used by the ecclesiastical system are simple to program. The following algorithm will compute the date of Easter in the Gregorian Calendar system.
The algorithm uses the year, y, to give the month, m, and day, d, of Easter. The symbol * means multiply.
Please note the following: This is an integer calculation. All variables are integers and all remainders from division are dropped. For example, 7 divided by 3 is equal to 2 in integer arithmetic.
c = y / 100
n = y - 19 * ( y / 19 )
k = ( c - 17 ) / 25
i = c - c / 4 - ( c - k ) / 3 + 19 * n + 15
i = i - 30 * ( i / 30 )
i = i - ( i / 28 ) * ( 1 - ( i / 28 ) * ( 29 / ( i + 1 ) ) * ( ( 21 - n ) / 11 ) )
j = y + y / 4 + i + 2 - c + c / 4
j = j - 7 * ( j / 7 )
l = i - j
m = 3 + ( l + 40 ) / 44
d = l + 28 - 31 * ( m / 4 )
For example, using the year 2010,
y=2010,
c=2010/100=20,
n=2010 - 19 x (2010/19) = 2010 - 19 x (105) = 15,   [see note above regarding integer calculations]
etc. resulting in Easter on April 4, 2010.
The algorithm is due to J.-M. Oudin (1940) and is reprinted in the Explanatory Supplement to the Astronomical Almanac, ed. P. K. Seidelmann (1992). See Chapter 12, "Calendars", by L. E. Doggett.

y 는 해당년도 대입 m은 부활달 d는 부활날이 된다. i 부분이 여러 곳에서 쓰이기 때문에 혼란이 올 수 있고 소수점 아래는 다 버리고 정수형만 취하기 때문에 프로그래밍시에 바로 적용 가능하다.
다른 이들이 보기에 좋게 하기 위해 몇가지 변수를 고쳐주면 될듯 싶다.



댓글 없음:

댓글 쓰기