commit | author | age
|
66d68b
|
1 |
/* |
U |
2 |
Zeitrechnung - a class library to determine calendar events |
|
3 |
Copyright (c) 1984-2023 Ulrich Hilger, http://uhilger.de |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as published by |
|
7 |
the Free Software Foundation, either version 3 of the License, or |
|
8 |
(at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.zeitrechnung.kalender; |
|
19 |
|
|
20 |
import de.uhilger.zeitrechnung.Definition; |
|
21 |
|
|
22 |
/** |
|
23 |
* Bestimmung des Ostersonntages als generisches Datum nach christlicher |
|
24 |
* sowie christlich orthodoxer Verwendung. |
|
25 |
* |
|
26 |
* @author Ulrich Hilger |
|
27 |
*/ |
|
28 |
public class ChristlicherKalender extends ISOKalender { |
|
29 |
|
|
30 |
public long ostern(long gregorianischesJahr) { |
|
31 |
long jahrhundert = 1 + ganzzahlQuotient(gregorianischesJahr, 100); |
|
32 |
long veraenderlicheEpakte = modulo(14 |
|
33 |
+ 11 * modulo(gregorianischesJahr, 19) |
|
34 |
- ganzzahlQuotient(3 * jahrhundert, 4) |
|
35 |
+ ganzzahlQuotient(5 + 8 * jahrhundert, 25), |
|
36 |
30); |
|
37 |
long berichtigteEpakte = veraenderlicheEpakte == 0 || |
|
38 |
(veraenderlicheEpakte == 1 && 10 < modulo(gregorianischesJahr, 19)) |
|
39 |
? veraenderlicheEpakte + 1 |
|
40 |
: veraenderlicheEpakte; |
|
41 |
long vollmondOstern = zuTagen(gregorianischesJahr, Definition.APRIL, 19) - |
|
42 |
berichtigteEpakte; |
|
43 |
return tagNach(vollmondOstern, Definition.SONNTAG); |
|
44 |
} |
|
45 |
|
|
46 |
public long orthodoxesOstern(long gregorianischesJahr) { |
|
47 |
long vollmondOstern = 354 * gregorianischesJahr |
|
48 |
+ 30 * ganzzahlQuotient((7 * gregorianischesJahr) - 8, 19) |
|
49 |
+ ganzzahlQuotient(gregorianischesJahr, 4) |
|
50 |
- ganzzahlQuotient(gregorianischesJahr, 19) |
|
51 |
- 272; |
|
52 |
return tagNach(vollmondOstern, Definition.SONNTAG); |
|
53 |
} |
|
54 |
|
|
55 |
} |