| 1 |
%-*- coding: utf-8 -*- |
| 2 |
|
| 3 |
% Damien Garrigues' ``nomogramme,'' reproduced from: |
| 4 |
% |
| 5 |
% @Article{garrigues:chronometrie1939, |
| 6 |
% author = "Damien Garrigues", |
| 7 |
% title = "{Généralisation de la formule pascale de Gauss: |
| 8 |
% Nomogramme du Calendrier perpétuel}", |
| 9 |
% journal = "Annales françaises de chronométrie", |
| 10 |
% year = "1939", |
| 11 |
% date = "1er trimestre 1939", |
| 12 |
% volume = "", |
| 13 |
% number = "", |
| 14 |
% pages = "47-60", |
| 15 |
% month = "", |
| 16 |
% language = "french", |
| 17 |
% } |
| 18 |
% |
| 19 |
% |
| 20 |
% Denis Roegel |
| 21 |
% 10-11 June 2001: initial version (complete, but not meant to be |
| 22 |
% described in an article) |
| 23 |
% |
| 24 |
% 16 October 2008: improved version using latexmp |
| 25 |
% 19 October 2008: some changes to make it more logical |
| 26 |
% (in particular, col4 has been renumbered from the bottom) |
| 27 |
% 20-24 October 2008: more changes and restructuration of the code, |
| 28 |
% improvements in labels and braces |
| 29 |
% 3-7 November 2008: addition of the special case of epact 25 which |
| 30 |
% had previously been forgotten (footnote (a) in |
| 31 |
% the Easter table area) |
| 32 |
% |
| 33 |
% |
| 34 |
% |
| 35 |
% Only part of the ``nomogramme'' is reproduced, |
| 36 |
% and this version is not completely identical to the original. |
| 37 |
% Some of the idiosyncrasies of the original drawing are difficult |
| 38 |
% to reproduce algorithmically and the purpose is not to create an |
| 39 |
% exact copy. |
| 40 |
% |
| 41 |
% It should also be noted that the code is much more complex than |
| 42 |
% it needs to be for the pure reproduction of Garrigues' drawing, |
| 43 |
% because we wanted in addition to show how the drawing is constructed, |
| 44 |
% and provide a number of partial views. As a consequence, the code |
| 45 |
% has been broken into many different pieces, and some related pieces |
| 46 |
% had to be put in different macros. |
| 47 |
% |
| 48 |
% For detailed explanations, see the accompanying article. |
| 49 |
|
| 50 |
input latexmp % for flexible latex labels |
| 51 |
input rboxes % for round boxes in column 10 |
| 52 |
|
| 53 |
numeric u; |
| 54 |
u=1mm; |
| 55 |
|
| 56 |
labeloffset:=7bp; |
| 57 |
|
| 58 |
numeric th_ex; |
| 59 |
th_ex=.5pt; % thickness of example dashed lines |
| 60 |
|
| 61 |
% label shifts in column 8: |
| 62 |
numeric col_shift_eight_a,col_shift_eight_b; |
| 63 |
col_shift_eight_a=6u; |
| 64 |
col_shift_eight_b=10u; |
| 65 |
|
| 66 |
def whateverpair=(whatever,whatever) enddef; |
| 67 |
|
| 68 |
% this macro formats the epact so that it fits on two characters |
| 69 |
% (using a phantom 0 on the left) |
| 70 |
def ep_st(expr i)= |
| 71 |
if i=0: textext("\phantom{0}$\star$") |
| 72 |
elseif i<10: |
| 73 |
textext("\phantom{0}"&decimal(i)) |
| 74 |
else: |
| 75 |
textext(decimal(i)) |
| 76 |
fi |
| 77 |
enddef; |
| 78 |
|
| 79 |
% this macro formats a number on two digits, adding a phantom 0 when |
| 80 |
% necessary |
| 81 |
def gstring(expr i)= |
| 82 |
if i<10: |
| 83 |
textext("\vphantom{(}\phantom{0}"&decimal(i)) |
| 84 |
else: |
| 85 |
textext("\vphantom{(}"&decimal(i)) |
| 86 |
fi |
| 87 |
enddef; |
| 88 |
|
| 89 |
def gpstring(expr i)= |
| 90 |
if i<10: |
| 91 |
textext("(\phantom{0}"&decimal(i)&")") |
| 92 |
else: |
| 93 |
textext("("&decimal(i)&")") |
| 94 |
fi |
| 95 |
enddef; |
| 96 |
|
| 97 |
% this macro adds a label within the Easter area at position (x,y) |
| 98 |
def label_easter_slot(expr x,y,lab)= |
| 99 |
label(lab,.5[s[x]r[y],s[x+1]l[y+1]]); |
| 100 |
enddef; |
| 101 |
|
| 102 |
% transform 1->A, 2->B, 3->C, 4->D, 5->E, 6->F, 7->G |
| 103 |
% for the correct display of the dominical letter |
| 104 |
def DL(expr i)= |
| 105 |
char(64+i) |
| 106 |
enddef; |
| 107 |
|
| 108 |
% i is the point number in column 2 (1 at the bottom), |
| 109 |
% and this macro returns a pair: |
| 110 |
% a) the Golden number associated to this point |
| 111 |
% b) the Julian epact associated to this point |
| 112 |
vardef gn_epact(expr i)= |
| 113 |
save G,JE; |
| 114 |
G=1+((9-11i) mod 19); |
| 115 |
JE=(11G-3) mod 30; |
| 116 |
(G,JE) % value returned |
| 117 |
enddef; |
| 118 |
|
| 119 |
% i is the point number in column 2 (1 at the bottom), |
| 120 |
% and this macro returns a pair: |
| 121 |
% a) the Golden number associated to this point |
| 122 |
% b) the corresponding point in column 4 (1 at the bottom) |
| 123 |
% (col. 4 = Julian epact) |
| 124 |
vardef gn_epactl(expr i)= |
| 125 |
save G,JE,JEL; |
| 126 |
G=1+((9-11i) mod 19); |
| 127 |
JE=(11G-3) mod 30; |
| 128 |
JEL=30-((JE+12) mod 30); |
| 129 |
(G,JEL) % value returned |
| 130 |
enddef; |
| 131 |
|
| 132 |
vardef sval(text sec)(text f)= |
| 133 |
save s;string s; |
| 134 |
% we build a string with space-separated values: |
| 135 |
for $=sec: |
| 136 |
if unknown s: |
| 137 |
s=f $; |
| 138 |
else: |
| 139 |
s:=s & " " & f $; |
| 140 |
fi; |
| 141 |
endfor; |
| 142 |
s |
| 143 |
enddef; |
| 144 |
|
| 145 |
% draw the values of the Gregorian secular parts in column 8; |
| 146 |
% each call corresponds to one line |
| 147 |
% i=circle from the bottom (i=1 to 4) |
| 148 |
% j=line within the circle (j=1 at the top) |
| 149 |
vardef secular_year(expr i,j)(text sec)= |
| 150 |
save vd; |
| 151 |
vd=4u; % vertical shift of the first line |
| 152 |
label(textext(sval(sec)(decimal)) scaled .5, |
| 153 |
col8[2i-1]+(10u,vd-(j-1)*.5vd)); |
| 154 |
enddef; |
| 155 |
|
| 156 |
def tddec expr i= |
| 157 |
if i<10: "0" & decimal(i) |
| 158 |
else: |
| 159 |
decimal(i) |
| 160 |
fi |
| 161 |
enddef; |
| 162 |
|
| 163 |
% i=box number, from 1 (at the bottom) to 7 (at the top) |
| 164 |
% j=1 or 3 (1 for the line at the top of a box, 3 for the line at the bottom) |
| 165 |
vardef yn(expr i,j)(text y)= |
| 166 |
save vd; |
| 167 |
vd=2u; % vertical shift of the first line |
| 168 |
label(textext(sval(y)(tddec)) scaled .5, |
| 169 |
col10[i]+(0,vd-(j-1)*vd)); |
| 170 |
enddef; |
| 171 |
|
| 172 |
% these numbers always appear at a fixed position: |
| 173 |
def yn_left(expr i)(text y)= |
| 174 |
label.rt(textext(sval(y)(tddec)) scaled .5,col10[i]+(-10u,0)); |
| 175 |
enddef; |
| 176 |
|
| 177 |
% these numbers always appear at a fixed position: |
| 178 |
def yn_right(expr i)(text y)= |
| 179 |
label.lft(textext(sval(y)(tddec)) scaled .5,col10[i]+(10u,0)); |
| 180 |
enddef; |
| 181 |
|
| 182 |
% list is a string with comma-separated values |
| 183 |
% l is the line number (1 at the bottom) |
| 184 |
vardef col_six_f(expr list,l)= |
| 185 |
save n,i;n=0; |
| 186 |
for $=scantokens(list): |
| 187 |
n:=n+1; |
| 188 |
endfor; |
| 189 |
% n is now the number of values in the list |
| 190 |
i=0; |
| 191 |
for $=scantokens(list): |
| 192 |
i:=i+1; |
| 193 |
if n>1: |
| 194 |
% if there is more than 1 value, the extreme values |
| 195 |
% are put at 2u below and above the center, |
| 196 |
% and the other values (if any) are spread evenly |
| 197 |
% in-between |
| 198 |
label(textext(decimal $) scaled .7, |
| 199 |
col6a[l]+(0,-2u+(i-1)*(4u/(n-1)))); |
| 200 |
else: |
| 201 |
% if there is only one value, it is centered; |
| 202 |
% there is only one such case |
| 203 |
label(textext(decimal $) scaled .7,col6a[l]); |
| 204 |
fi; |
| 205 |
endfor; |
| 206 |
enddef; |
| 207 |
|
| 208 |
vardef col_one_three_f(expr list,l,c)= |
| 209 |
save n,i;n=0; |
| 210 |
for $=scantokens(list): |
| 211 |
n:=n+1; |
| 212 |
endfor; |
| 213 |
i=0; |
| 214 |
for $=scantokens(list): |
| 215 |
i:=i+1; |
| 216 |
label(textext(if c=3: (tddec $) else: decimal $ fi) |
| 217 |
scaled .6, |
| 218 |
col[c][l]+((if c=3: 2.5u else: 2u fi,0) |
| 219 |
rotated (180-(i-1)*360/n))); |
| 220 |
endfor; |
| 221 |
enddef; |
| 222 |
|
| 223 |
% variables for the regular columns and circle radiuses |
| 224 |
pair col[][],col[]a[]; |
| 225 |
numeric height;height=150u; % vertical dimension of the drawing |
| 226 |
numeric diam[]; |
| 227 |
|
| 228 |
% variables for labels |
| 229 |
string col[][]st; |
| 230 |
|
| 231 |
% variables for the Easter table: |
| 232 |
pair B,C; |
| 233 |
pair s[]r[],s[]l[]; |
| 234 |
|
| 235 |
% define the points in columns 1-7 |
| 236 |
vardef define_first_cols= |
| 237 |
save E; |
| 238 |
diam1=(height-18*.5)/18; |
| 239 |
for i:=1 upto 19: |
| 240 |
col1[i]=(0,(i-1)*height/18); |
| 241 |
endfor; |
| 242 |
for i:=1 upto 19: |
| 243 |
col3[i]=(40u,(i-1)*height/18); |
| 244 |
endfor; |
| 245 |
for i:=1 upto 37: |
| 246 |
col2[i]=((xpart(col1[1])+xpart(col3[1]))/2, |
| 247 |
.5*(i-1)*height/18); |
| 248 |
endfor; |
| 249 |
for i:=1 upto 37: |
| 250 |
E:=ypart(gn_epactl(i)); |
| 251 |
col4[E]=(60u,(E-1)*height/29); |
| 252 |
endfor; |
| 253 |
for i:=1 upto 30: |
| 254 |
col6[i]=(110u,(i-1)*height/29); |
| 255 |
endfor; |
| 256 |
for i:=1 upto 58: |
| 257 |
col5[i]=((xpart(col4[1])+xpart(col6[1]))/2,.5*(i-1)*height/29); |
| 258 |
endfor; |
| 259 |
for i:=1 upto 30: |
| 260 |
% the circles for column 6 appear alternately |
| 261 |
% on the right and on the left of the center corresponding to col6 |
| 262 |
if i mod 2=0: |
| 263 |
col6a[i]=col6[i]-(8u,0); |
| 264 |
else: |
| 265 |
col6a[i]=col6[i]+(8u,0); |
| 266 |
fi; |
| 267 |
endfor; |
| 268 |
for i:=1 upto 30: |
| 269 |
% the values in column 7 are shifted vertically by 20u: |
| 270 |
col7[i]=(130u,20u+(i-1)*(height-20u)/29); |
| 271 |
endfor; |
| 272 |
enddef; |
| 273 |
|
| 274 |
% define strings containing the numbers in the circles of column 1 |
| 275 |
vardef define_col_one_labels= |
| 276 |
save p; |
| 277 |
for i=0 upto 84: % only S=0 to 84 are considered |
| 278 |
p:=1+(9+3i) mod 19; |
| 279 |
if unknown col1[p]st: |
| 280 |
col1[p]st=decimal(i); |
| 281 |
else: |
| 282 |
col1[p]st |
| 283 |
:=col1[p]st & "," & decimal(i); |
| 284 |
fi; |
| 285 |
endfor; |
| 286 |
enddef; |
| 287 |
|
| 288 |
% define strings containing the numbers in the circles of column 3 |
| 289 |
vardef define_col_three_labels= |
| 290 |
save p; |
| 291 |
for i=0 upto 99: |
| 292 |
p:=1+(15+12i) mod 19; |
| 293 |
if unknown col3[p]st: |
| 294 |
col3[p]st=decimal(i); |
| 295 |
else: |
| 296 |
col3[p]st |
| 297 |
:=col3[p]st & "," & decimal(i); |
| 298 |
fi; |
| 299 |
endfor; |
| 300 |
enddef; |
| 301 |
|
| 302 |
% define strings containing the numbers in the circles of column 6 |
| 303 |
vardef define_col_six_labels= |
| 304 |
save p,M; |
| 305 |
for i=15 upto 84: % all secular parts of column 6 |
| 306 |
% find the line number where it goes |
| 307 |
M:=(15+i-floor(i/4)-floor((8i+13)/25)) mod 30; |
| 308 |
p:=1+(M+21) mod 30; |
| 309 |
if unknown col6[p]st: |
| 310 |
col6[p]st=decimal(i); |
| 311 |
else: |
| 312 |
col6[p]st:=col6[p]st & "," & decimal(i); |
| 313 |
fi; |
| 314 |
endfor; |
| 315 |
enddef; |
| 316 |
|
| 317 |
def draw_col_one_points= |
| 318 |
for i:=1 upto 19: |
| 319 |
drawdot col1[i]; |
| 320 |
endfor; |
| 321 |
enddef; |
| 322 |
|
| 323 |
def draw_col_two_points= |
| 324 |
for i:=1 upto 37: |
| 325 |
drawdot col2[i]; |
| 326 |
endfor; |
| 327 |
enddef; |
| 328 |
|
| 329 |
def draw_col_three_points= |
| 330 |
for i:=1 upto 19: |
| 331 |
drawdot col3[i]; |
| 332 |
endfor; |
| 333 |
enddef; |
| 334 |
|
| 335 |
vardef draw_col_four_points= |
| 336 |
save GNE;pair GNE; |
| 337 |
for i:=1 upto 37: |
| 338 |
GNE:=whateverpair;GNE=gn_epactl(i); |
| 339 |
drawdot col4[ypart(GNE)]; |
| 340 |
endfor; |
| 341 |
enddef; |
| 342 |
|
| 343 |
def draw_col_five_points= |
| 344 |
for i:=1 upto 58: |
| 345 |
drawdot col5[i]; |
| 346 |
endfor; |
| 347 |
enddef; |
| 348 |
|
| 349 |
def draw_col_six_points= |
| 350 |
for i:=1 upto 30: |
| 351 |
drawdot col6[i]; |
| 352 |
endfor; |
| 353 |
enddef; |
| 354 |
|
| 355 |
def draw_col_seven_points= |
| 356 |
for i:=1 upto 30: |
| 357 |
drawdot col7[i]; |
| 358 |
endfor; |
| 359 |
enddef; |
| 360 |
|
| 361 |
def draw_col_eight_points= |
| 362 |
for i=1 upto 7: |
| 363 |
drawdot col8[i]; |
| 364 |
endfor; |
| 365 |
enddef; |
| 366 |
|
| 367 |
def draw_col_nine_points= |
| 368 |
for i=1 upto 13: |
| 369 |
drawdot col9[i]; |
| 370 |
endfor; |
| 371 |
enddef; |
| 372 |
|
| 373 |
def draw_col_ten_points= |
| 374 |
for i=1 upto 7: |
| 375 |
drawdot col10[i]; |
| 376 |
endfor; |
| 377 |
enddef; |
| 378 |
|
| 379 |
def draw_col_eleven_points= |
| 380 |
for i=1 upto 7: |
| 381 |
drawdot col11[i]; |
| 382 |
endfor; |
| 383 |
enddef; |
| 384 |
|
| 385 |
vardef draw_block_one_points= |
| 386 |
save oldpen; |
| 387 |
oldpen=savepen; |
| 388 |
pickup pencircle scaled 2pt; |
| 389 |
draw_col_one_points; |
| 390 |
draw_col_two_points; |
| 391 |
draw_col_three_points; |
| 392 |
pickup oldpen; |
| 393 |
enddef; |
| 394 |
|
| 395 |
vardef draw_block_two_points= |
| 396 |
save oldpen; |
| 397 |
oldpen=savepen; |
| 398 |
pickup pencircle scaled 2pt; |
| 399 |
draw_col_two_points; |
| 400 |
%draw_col_three_points; |
| 401 |
draw_col_four_points; |
| 402 |
pickup oldpen; |
| 403 |
enddef; |
| 404 |
|
| 405 |
vardef draw_block_three_points= |
| 406 |
save oldpen; |
| 407 |
oldpen=savepen; |
| 408 |
pickup pencircle scaled 2pt; |
| 409 |
draw_col_four_points; |
| 410 |
draw_col_five_points; |
| 411 |
draw_col_six_points; |
| 412 |
pickup oldpen; |
| 413 |
enddef; |
| 414 |
|
| 415 |
vardef draw_block_four_points= |
| 416 |
save oldpen; |
| 417 |
oldpen=savepen; |
| 418 |
pickup pencircle scaled 2pt; |
| 419 |
draw_col_five_points; |
| 420 |
%draw_col_six_points; |
| 421 |
draw_col_seven_points; |
| 422 |
pickup oldpen; |
| 423 |
enddef; |
| 424 |
|
| 425 |
vardef draw_block_five_points= |
| 426 |
save oldpen; |
| 427 |
oldpen=savepen; |
| 428 |
pickup pencircle scaled 2pt; |
| 429 |
draw_col_eight_points; |
| 430 |
draw_col_nine_points; |
| 431 |
draw_col_ten_points; |
| 432 |
pickup oldpen; |
| 433 |
enddef; |
| 434 |
|
| 435 |
vardef draw_block_six_points= |
| 436 |
save oldpen; |
| 437 |
oldpen=savepen; |
| 438 |
pickup pencircle scaled 2pt; |
| 439 |
%draw_col_eight_points; |
| 440 |
draw_col_nine_points; |
| 441 |
draw_col_eleven_points; |
| 442 |
pickup oldpen; |
| 443 |
enddef; |
| 444 |
|
| 445 |
vardef draw_block_seven_points= |
| 446 |
save oldpen; |
| 447 |
oldpen=savepen; |
| 448 |
pickup pencircle scaled 2pt; |
| 449 |
draw_col_seven_points; |
| 450 |
draw_col_eleven_points; |
| 451 |
pickup oldpen; |
| 452 |
enddef; |
| 453 |
|
| 454 |
% draw the various points in the columns: |
| 455 |
vardef draw_all_points= |
| 456 |
save oldpen; |
| 457 |
oldpen=savepen; |
| 458 |
pickup pencircle scaled 2pt; |
| 459 |
draw_block_one_points; |
| 460 |
draw_block_three_points; |
| 461 |
draw_block_five_points; |
| 462 |
draw_block_seven_points; |
| 463 |
pickup oldpen; |
| 464 |
enddef; |
| 465 |
|
| 466 |
vardef draw_block_two_connections= |
| 467 |
for i:=1 upto 37: |
| 468 |
draw col2[i]--col4[ypart(gn_epactl(i))]; |
| 469 |
endfor; |
| 470 |
enddef; |
| 471 |
|
| 472 |
def draw_block_four_connections= |
| 473 |
for i:=1 upto 58: |
| 474 |
draw col5[i]--col7[1+((i-1) mod 30)]; |
| 475 |
endfor; |
| 476 |
enddef; |
| 477 |
|
| 478 |
def draw_block_six_connections= |
| 479 |
for i=1 upto 13: |
| 480 |
draw col9[i]--col11[1+(13-i) mod 7]; |
| 481 |
endfor; |
| 482 |
enddef; |
| 483 |
|
| 484 |
% draw the lines connecting the points |
| 485 |
def draw_all_connections= |
| 486 |
draw_block_two_connections; |
| 487 |
draw_block_four_connections; |
| 488 |
draw_block_six_connections; |
| 489 |
enddef; |
| 490 |
|
| 491 |
% connecting the secular part to the last two digits of the year: |
| 492 |
vardef draw_block_one_example= |
| 493 |
save oldpen; |
| 494 |
oldpen=savepen; |
| 495 |
draw col1[10]--col3[9] withcolor white; % erasing the old connection |
| 496 |
pickup pencircle scaled th_ex; |
| 497 |
draw col1[10]--col3[9] dashed evenly; |
| 498 |
pickup oldpen; |
| 499 |
enddef; |
| 500 |
|
| 501 |
% connecting the Golden number to the Julian epact: |
| 502 |
vardef draw_block_two_example= |
| 503 |
save oldpen; |
| 504 |
oldpen=savepen; |
| 505 |
draw col2[18]--col4[29] withcolor white; % erasing the old connection |
| 506 |
pickup pencircle scaled th_ex; |
| 507 |
draw col2[18]--col4[29] dashed evenly; |
| 508 |
pickup oldpen; |
| 509 |
enddef; |
| 510 |
|
| 511 |
% connecting the Julian epact to M: |
| 512 |
vardef draw_block_three_example= |
| 513 |
save oldpen; |
| 514 |
oldpen=savepen; |
| 515 |
draw col4[29]--col6[16] withcolor white; % erasing the old connection |
| 516 |
pickup pencircle scaled th_ex; |
| 517 |
draw col4[29]--col6[16] dashed evenly; |
| 518 |
pickup oldpen; |
| 519 |
enddef; |
| 520 |
|
| 521 |
% connecting the Gregorian epacts: |
| 522 |
vardef draw_block_four_example= |
| 523 |
save oldpen; |
| 524 |
oldpen=savepen; |
| 525 |
draw col5[44]--col7[14] withcolor white; % erasing the old connection |
| 526 |
pickup pencircle scaled th_ex; |
| 527 |
draw col5[44]--col7[14] dashed evenly; |
| 528 |
pickup oldpen; |
| 529 |
enddef; |
| 530 |
|
| 531 |
% connecting the secular part of the year to the |
| 532 |
% last two digits, in order to obtain the dominical letter: |
| 533 |
vardef draw_block_five_example= |
| 534 |
save oldpen; |
| 535 |
oldpen=savepen; |
| 536 |
draw col8[7]--col10[5] withcolor white; % erasing the old connection |
| 537 |
pickup pencircle scaled th_ex; |
| 538 |
draw col8[7]--col10[5] dashed evenly; |
| 539 |
pickup oldpen; |
| 540 |
enddef; |
| 541 |
|
| 542 |
% connecting the dominical letters together: |
| 543 |
vardef draw_block_six_example= |
| 544 |
save oldpen; |
| 545 |
oldpen=savepen; |
| 546 |
draw col9[11]--col11[3] withcolor white; % erasing the old connection |
| 547 |
pickup pencircle scaled th_ex; |
| 548 |
draw col9[11]--col11[3] dashed evenly; |
| 549 |
pickup oldpen; |
| 550 |
enddef; |
| 551 |
|
| 552 |
vardef draw_block_seven_example= |
| 553 |
save oldpen; |
| 554 |
oldpen=savepen; |
| 555 |
pickup pencircle scaled th_ex; |
| 556 |
% connecting all Easter dates with the same dominical letter A: |
| 557 |
draw col11[3]--C dashed evenly; |
| 558 |
% connecting all Easter dates with the same Gregorian epact value: |
| 559 |
draw col7[14]--B dashed evenly; |
| 560 |
% showing the Easter date: |
| 561 |
pickup pencircle scaled 3pt; |
| 562 |
draw (col11[3]--C) intersectionpoint (col7[14]--B); |
| 563 |
pickup oldpen; |
| 564 |
enddef; |
| 565 |
|
| 566 |
% example for 1939: |
| 567 |
def draw_all_example= |
| 568 |
draw_block_one_example; |
| 569 |
draw_block_two_example; |
| 570 |
draw_block_three_example; |
| 571 |
draw_block_four_example; |
| 572 |
draw_block_five_example; |
| 573 |
draw_block_six_example; |
| 574 |
draw_block_seven_example; |
| 575 |
enddef; |
| 576 |
|
| 577 |
def draw_dbl_circle(expr da,db,c) text options= |
| 578 |
unfill fullcircle scaled db shifted c; |
| 579 |
draw fullcircle scaled db shifted c; |
| 580 |
draw fullcircle scaled da shifted c options; |
| 581 |
enddef; |
| 582 |
|
| 583 |
% circles in column 1: |
| 584 |
def draw_col_one_circles= |
| 585 |
for i:=1 upto 19: |
| 586 |
draw_dbl_circle(.9diam1,diam1,col1[i]); |
| 587 |
endfor; |
| 588 |
enddef; |
| 589 |
|
| 590 |
% extra labels for block one: |
| 591 |
def draw_col_one_circle_labels= |
| 592 |
for i:=1 upto 19: |
| 593 |
label.lft(textext(decimal((4+8*(i-1)) mod 19)),col1[i]+7u*left); |
| 594 |
endfor; |
| 595 |
enddef; |
| 596 |
|
| 597 |
% circles in column 3: |
| 598 |
def draw_col_three_circles= |
| 599 |
for i:=1 upto 19: |
| 600 |
% this produces a simple circle: |
| 601 |
draw_dbl_circle(diam1,diam1,col3[i]); |
| 602 |
endfor; |
| 603 |
enddef; |
| 604 |
|
| 605 |
% extra labels for block one: |
| 606 |
def draw_col_three_circle_labels= |
| 607 |
for i:=1 upto 19: |
| 608 |
label.lft(textext(decimal((13+8*(i-1)) mod 19)),col3[i]+13u*right); |
| 609 |
endfor; |
| 610 |
enddef; |
| 611 |
|
| 612 |
def draw_col_six_circles= |
| 613 |
% circles around column 6: |
| 614 |
for i:=1 upto 30: |
| 615 |
draw_dbl_circle(.9diam1,diam1,col6a[i]); |
| 616 |
endfor; |
| 617 |
% special case of the Julian calendar: |
| 618 |
draw_dbl_circle(.9diam1,diam1,col6[7]-(17u,0)) dashed evenly; |
| 619 |
drawarrow (col6[7]-(17u,0))--col6[7] |
| 620 |
cutbefore (fullcircle scaled diam1 shifted (col6[7]-(17u,0))); |
| 621 |
label(textext("\vbox{\halign{\hfil#\hfil\cr Jul.\cr Cal.\cr}}") scaled .7, |
| 622 |
col6[7]-(17u,0)); |
| 623 |
enddef; |
| 624 |
|
| 625 |
% circles around column 8: |
| 626 |
def draw_col_eight_circles= |
| 627 |
for i=1 upto 7: |
| 628 |
draw_dbl_circle(.9diam2,diam2,col8[i]-(col_shift_eight_a,0)); |
| 629 |
if i mod 2=1: |
| 630 |
draw_dbl_circle(.9diam3,diam3,col8[i]+(col_shift_eight_b,0)); |
| 631 |
fi; |
| 632 |
endfor; |
| 633 |
enddef; |
| 634 |
|
| 635 |
def draw_block_one_circles= |
| 636 |
draw_col_one_circles; |
| 637 |
draw_col_one_circle_labels; |
| 638 |
draw_col_three_circles; |
| 639 |
draw_col_three_circle_labels; |
| 640 |
enddef; |
| 641 |
|
| 642 |
def draw_block_two_circles= |
| 643 |
draw_col_three_circles; |
| 644 |
enddef; |
| 645 |
|
| 646 |
def draw_block_three_circles= |
| 647 |
draw_col_six_circles; |
| 648 |
enddef; |
| 649 |
|
| 650 |
def draw_block_four_circles= |
| 651 |
draw_col_six_circles; |
| 652 |
enddef; |
| 653 |
|
| 654 |
def draw_block_five_circles= |
| 655 |
draw_col_eight_circles; |
| 656 |
enddef; |
| 657 |
|
| 658 |
def draw_block_six_circles= |
| 659 |
draw_col_eight_circles; |
| 660 |
enddef; |
| 661 |
|
| 662 |
def draw_all_circles= |
| 663 |
draw_col_one_circles; |
| 664 |
draw_col_three_circles; |
| 665 |
draw_col_six_circles; |
| 666 |
draw_col_eight_circles; |
| 667 |
enddef; |
| 668 |
|
| 669 |
% display values in circles of column 1: |
| 670 |
def draw_labels_col_one= |
| 671 |
for i=1 upto 19: |
| 672 |
col_one_three_f(col1[i]st,i,1); |
| 673 |
endfor; |
| 674 |
label(textext("I"),col1[1]-(0,10u)); |
| 675 |
label(textext("$S$") scaled 1.5,col1[19]+(col1[19]-col1[18])); |
| 676 |
enddef; |
| 677 |
|
| 678 |
def draw_labels_col_two_a= |
| 679 |
label(textext("II"),col2[1]-(0,10u)); |
| 680 |
enddef; |
| 681 |
|
| 682 |
% this is an extended display |
| 683 |
vardef draw_labels_col_two_b= |
| 684 |
save GNE;pair GNE; |
| 685 |
for i:=1 upto 37: |
| 686 |
GNE:=whateverpair;GNE=gn_epact(i); |
| 687 |
% some of the values here are written twice, but this causes no harm: |
| 688 |
label.rt(gstring(xpart(GNE)),col2[i]); |
| 689 |
label.lft(gstring(ypart(GNE)),col2[i]); |
| 690 |
endfor; |
| 691 |
label.lft(textext("$E_J$"),col2[37]+(col2[37]-col2[36])); |
| 692 |
label.rt(textext("$G$"),col2[37]+(col2[37]-col2[36])); |
| 693 |
enddef; |
| 694 |
|
| 695 |
% this is an extended display |
| 696 |
vardef draw_labels_col_two_c= |
| 697 |
save GNE;pair GNE; |
| 698 |
for i:=1 upto 37: |
| 699 |
GNE:=whateverpair;GNE=gn_epact(i); |
| 700 |
% some of the values here are written twice, but this causes no harm: |
| 701 |
label.lft(gstring(xpart(GNE)),col2[i]+15u*left); |
| 702 |
label.lft(gpstring(ypart(GNE)),col2[i]+5u*left); |
| 703 |
endfor; |
| 704 |
label.lft(textext("$G$"),col2[37]+(col2[37]-col2[36])+15u*left); |
| 705 |
label.lft(textext("$E_J$"),col2[37]+(col2[37]-col2[36])+5u*left); |
| 706 |
enddef; |
| 707 |
|
| 708 |
% display values in circles of column 3: |
| 709 |
def draw_labels_col_three= |
| 710 |
for i=1 upto 19: |
| 711 |
col_one_three_f(col3[i]st,i,3); |
| 712 |
endfor; |
| 713 |
label(textext("III"),col3[1]-(0,10u)); |
| 714 |
label(textext("$A$") scaled 1.5,col3[19]+(col3[19]-col3[18])); |
| 715 |
enddef; |
| 716 |
|
| 717 |
vardef draw_labels_col_four_base= |
| 718 |
save GNE;pair GNE; |
| 719 |
for i:=1 upto 37: |
| 720 |
GNE:=whateverpair;GNE=gn_epactl(i); |
| 721 |
% some of the values here are written twice, but this causes no harm: |
| 722 |
label.rt(gstring(xpart(GNE)),col4[ypart(GNE)]); |
| 723 |
endfor; |
| 724 |
enddef; |
| 725 |
|
| 726 |
% display labels in column 4 (values of the Golden number) |
| 727 |
def draw_labels_col_four_a= |
| 728 |
draw_labels_col_four_base; |
| 729 |
label.lft(textext("IV"),col4[1]-(0,10u)); |
| 730 |
label.rt(textext("Gold. N.") rotated 90,col4[1]-(0,10u)); |
| 731 |
enddef; |
| 732 |
|
| 733 |
def draw_labels_col_four_b= |
| 734 |
draw_labels_col_four_base; |
| 735 |
label(textext("IV"),col4[1]-(0,10u)); |
| 736 |
enddef; |
| 737 |
|
| 738 |
vardef draw_labels_col_four_c= |
| 739 |
save GNE,GNEL;pair GNE,GNEL; |
| 740 |
for i:=1 upto 37: |
| 741 |
GNEL:=whateverpair;GNEL=gn_epactl(i); |
| 742 |
GNE:=whateverpair;GNE=gn_epact(i); |
| 743 |
label.rt(gpstring(ypart(GNE)),col4[ypart(GNEL)]+5u*right); |
| 744 |
endfor; |
| 745 |
label.rt(textext("$G$"),col4[29]+(col4[29]-col4[28])); |
| 746 |
label.rt(textext("$E_J$"),col4[29]+(col4[29]-col4[28])+5u*right); |
| 747 |
enddef; |
| 748 |
|
| 749 |
vardef draw_labels_col_four_d= |
| 750 |
save GNE,GNEL;pair GNE,GNEL; |
| 751 |
for i:=1 upto 37: |
| 752 |
GNEL:=whateverpair;GNEL=gn_epactl(i); |
| 753 |
GNE:=whateverpair;GNE=gn_epact(i); |
| 754 |
label.lft(gstring(xpart(GNEL)),col4[ypart(GNEL)]+8u*left); |
| 755 |
label.lft(gpstring(ypart(GNE)),col4[ypart(GNEL)]); |
| 756 |
endfor; |
| 757 |
label.lft(textext("$G$"),col4[29]+(col4[29]-col4[28])+8u*left); |
| 758 |
label.lft(textext("$E_J$"),col4[29]+(col4[29]-col4[28])); |
| 759 |
label.lft(textext("IV"),col4[1]-(0,10u)); |
| 760 |
enddef; |
| 761 |
|
| 762 |
def draw_labels_col_five= |
| 763 |
for i=1 upto 58: |
| 764 |
label.lft(ep_st((24-i) mod 30) scaled .7,col5[i]); |
| 765 |
endfor; |
| 766 |
label.lft(textext("$E_G$"),col5[58]+2(col5[58]-col5[57])); |
| 767 |
label(textext("V"),col5[1]-(0,10u)); |
| 768 |
enddef; |
| 769 |
|
| 770 |
def draw_labels_col_five_a= |
| 771 |
label(textext("V"),col5[1]-(0,10u)); |
| 772 |
enddef; |
| 773 |
|
| 774 |
% display values in circles of column 6: |
| 775 |
def draw_labels_col_six_a= |
| 776 |
for i=1 upto 30: |
| 777 |
col_six_f(col6[i]st,i); |
| 778 |
endfor; |
| 779 |
label(textext("VI"),col6[1]-(0,10u)); |
| 780 |
label(textext("$S$") scaled 1.5,col6[30]+2(col6[30]-col6[29])); |
| 781 |
enddef; |
| 782 |
|
| 783 |
vardef draw_labels_col_six_b= |
| 784 |
save lo; |
| 785 |
lo=labeloffset; |
| 786 |
labeloffset:=3bp; |
| 787 |
for i=1 upto 30: |
| 788 |
label.rt(gstring((7-i) mod 30) scaled .5,col6[i]); |
| 789 |
endfor; |
| 790 |
labeloffset:=lo; |
| 791 |
label(textext("$15-M$") scaled .7,col6[30]+.5(col6[30]-col6[29])+2u*right); |
| 792 |
enddef; |
| 793 |
|
| 794 |
% display values of the Gregorian epact |
| 795 |
def draw_labels_col_seven_a= |
| 796 |
for i:=1 upto 30: |
| 797 |
label.rt(ep_st((24-i) mod 30),col7[i]); |
| 798 |
endfor; |
| 799 |
label(textext("VII"),col7[1]-(0,20u)); |
| 800 |
label.rt(textext("Epact:") rotated 90,col7[1]-(0,10u)); |
| 801 |
enddef; |
| 802 |
|
| 803 |
def draw_labels_col_seven_b= |
| 804 |
draw_labels_col_seven_a; |
| 805 |
label.rt(textext("$E_G$"),col7[30]+(col7[30]-col7[29])); |
| 806 |
enddef; |
| 807 |
|
| 808 |
def draw_labels_col_seven_c= |
| 809 |
for i:=1 upto 30: |
| 810 |
label.lft(ep_st((24-i) mod 30),col7[i]); |
| 811 |
endfor; |
| 812 |
label.lft(textext("$E_G$"),col7[30]+2(col7[30]-col7[29])); |
| 813 |
label(textext("VII"),col7[1]-(0,20u)); |
| 814 |
label.lft(textext("Epact:") rotated 90,col7[1]-(0,10u)); |
| 815 |
enddef; |
| 816 |
|
| 817 |
def draw_block_one_labels= |
| 818 |
draw_labels_col_one; |
| 819 |
draw_labels_col_two_a; |
| 820 |
draw_labels_col_three; |
| 821 |
enddef; |
| 822 |
|
| 823 |
def draw_block_two_labels= |
| 824 |
draw_labels_col_two_a; |
| 825 |
draw_labels_col_four_b; |
| 826 |
enddef; |
| 827 |
|
| 828 |
def draw_block_three_labels= |
| 829 |
draw_labels_col_four_d; |
| 830 |
draw_labels_col_five; |
| 831 |
draw_labels_col_six_a; |
| 832 |
draw_labels_col_six_b; |
| 833 |
enddef; |
| 834 |
|
| 835 |
def draw_block_four_labels= |
| 836 |
draw_labels_col_five; |
| 837 |
draw_labels_col_seven_b; |
| 838 |
enddef; |
| 839 |
|
| 840 |
% draw the labels in columns 1-7 |
| 841 |
def draw_first_labels= |
| 842 |
draw_labels_col_one; |
| 843 |
draw_labels_col_three; |
| 844 |
draw_labels_col_four_a; |
| 845 |
draw_labels_col_five_a; |
| 846 |
draw_labels_col_six_a; |
| 847 |
draw_labels_col_seven_a; |
| 848 |
enddef; |
| 849 |
|
| 850 |
def define_corners= |
| 851 |
corner1=whatever[col7[0],B] |
| 852 |
=C+whatever*up; |
| 853 |
corner3=.3[B,col7[31]]; % can be positioned freely |
| 854 |
corner2=(C--corner3) intersectionpoint (B--corner1); |
| 855 |
corner4=whatever[B,col7[31]] |
| 856 |
=C+whatever*up; |
| 857 |
enddef; |
| 858 |
|
| 859 |
vardef define_easter_table= |
| 860 |
save corner,p; |
| 861 |
pair corner[]; |
| 862 |
% B and C can be positioned freely: |
| 863 |
C=(xpart(col7[1])+10u,-10u); |
| 864 |
B=(xpart(C)+150u,ypart(col7[5])); |
| 865 |
% we define two additional points in column 7, |
| 866 |
% one above the 30th, and one below the first: |
| 867 |
col7[1]-col7[0]=col7[31]-col7[30]=col7[2]-col7[1]; |
| 868 |
% these four corners define the shape of area XI: |
| 869 |
define_corners; |
| 870 |
% area XI is divided into 8 slices (9 boundaries, |
| 871 |
% only 8 of which are drawn) |
| 872 |
for i=1 upto 9: |
| 873 |
s[i]l0=s[i]r0=(((i-1)/8))[corner4,corner3]; |
| 874 |
s[i]l5=s[i]r5 |
| 875 |
=whatever[corner1,corner2]=whatever[s[i]l0,C]; |
| 876 |
endfor; |
| 877 |
% each of the eight slices is itself divided four times: |
| 878 |
for i=1 upto 8: % i varies on the ``vertical lines,'' |
| 879 |
% from left to right; 8 vertical lines enclose the |
| 880 |
% 35 easter slots; |
| 881 |
for j=1 upto 4: % j varies on the horizontal inner divisions |
| 882 |
p:=30-i-(j-1)*7; |
| 883 |
% from top to bottom |
| 884 |
if i<8: |
| 885 |
% division leaving to the right of vertical line i |
| 886 |
s[i]r[j]=(s[i]l0--s[i]l5) |
| 887 |
intersectionpoint (B--.5[col7[p],col7[p-1]]); |
| 888 |
fi; |
| 889 |
if i>1: |
| 890 |
% division leaving to the left of vertical line i |
| 891 |
s[i]l[j]=(s[i]l0--s[i]l5) |
| 892 |
intersectionpoint |
| 893 |
(B--.5[col7[p+1],col7[p]]); |
| 894 |
fi; |
| 895 |
endfor; |
| 896 |
endfor; |
| 897 |
enddef; |
| 898 |
|
| 899 |
% draw points B and C |
| 900 |
vardef draw_B_and_C= |
| 901 |
save oldpen; |
| 902 |
oldpen=savepen; |
| 903 |
draw_dbl_circle(.8*3u,3u,B); |
| 904 |
draw_dbl_circle(.8*3u,3u,C); |
| 905 |
pickup pencircle scaled 2pt; |
| 906 |
drawdot B;drawdot C; |
| 907 |
pickup oldpen; |
| 908 |
label.ulft(textext("$B$"),B); |
| 909 |
label.ulft(textext("$C$"),C); |
| 910 |
enddef; |
| 911 |
|
| 912 |
% draw the slices in the Easter table: |
| 913 |
vardef draw_easter_table_slices= |
| 914 |
save oldpen; |
| 915 |
oldpen=savepen; |
| 916 |
for i=1 upto 8: |
| 917 |
draw s[i]l0--s[i]l5; |
| 918 |
endfor; |
| 919 |
draw s8l5--s8l0--s1l0--s1l5--cycle; |
| 920 |
for i=1 upto 7: |
| 921 |
for j=1 upto 4: |
| 922 |
draw s[i]r[j]--s[i+1]l[j]; |
| 923 |
endfor; |
| 924 |
endfor; |
| 925 |
pickup pencircle scaled 2pt; |
| 926 |
% March/April divisions: |
| 927 |
draw s8l3--s7r3--s7l3--s6r3--s6l3--s5r3-- |
| 928 |
s5l4--s4r4--s4l4--s3r4--s3l4-- |
| 929 |
s2r4--s2l4--s1r4; |
| 930 |
pickup oldpen; |
| 931 |
enddef; |
| 932 |
|
| 933 |
vardef draw_arrow_label@#(expr lab,c,s)= |
| 934 |
save oldpen; |
| 935 |
oldpen=savepen; |
| 936 |
pickup pencircle scaled 2pt; |
| 937 |
draw (c); |
| 938 |
pickup oldpen; |
| 939 |
drawarrow (c+s)--(c+u*unitvector(s)); |
| 940 |
label@#(lab,c+s); |
| 941 |
enddef; |
| 942 |
|
| 943 |
|
| 944 |
vardef draw_easter_table_details= |
| 945 |
save corner; |
| 946 |
pair corner[]; |
| 947 |
define_corners; |
| 948 |
draw_arrow_label.top(textext("\tt corner4"),corner4,(0,10u)); |
| 949 |
draw_arrow_label.urt(textext("\tt corner3"),corner3,10u*dir(20)); |
| 950 |
draw_arrow_label.lrt(textext("\tt corner2"),corner2,10u*dir(-20)); |
| 951 |
draw_arrow_label.llft(textext("\tt corner1"),corner1,25u*dir(-132)); |
| 952 |
|
| 953 |
draw_arrow_label.top(textext("\tt s2l0"),s[2]l[0],30u*dir(80)); |
| 954 |
draw_arrow_label.rt(textext("\tt s2r0"),s[2]r[0],40u*dir(10)); |
| 955 |
draw_arrow_label.top(textext("\tt s4l0"),s[4]l[0],12u*dir(90)); |
| 956 |
draw_arrow_label.rt(textext("\tt s4r0"),s[4]r[0],20u*dir(5)); |
| 957 |
draw_arrow_label.lrt(textext("\tt s7l3"),s[7]l[3],40u*dir(-10)); |
| 958 |
draw_arrow_label.lrt(textext("\tt s7r3"),s[7]r[3],40u*dir(-40)); |
| 959 |
draw_arrow_label.rt(textext("\tt s7r2"),s[7]r[2],60u*dir(5)); |
| 960 |
|
| 961 |
draw corner1--corner2 dashed evenly; |
| 962 |
draw corner4--corner3 dashed evenly; |
| 963 |
draw corner2--corner3 dashed evenly; |
| 964 |
enddef; |
| 965 |
|
| 966 |
% draw the labels in the Easter table: |
| 967 |
vardef draw_easter_table_labels= |
| 968 |
save laban,march,april,sl,j; |
| 969 |
string march,april; |
| 970 |
for i=1 upto 35: % 35 dates from March 22 till April 25 |
| 971 |
sl:=1+(7-(i mod 7)) mod 7; |
| 972 |
j:=4-floor((i-1)/7); |
| 973 |
label_easter_slot(sl,j,textext(if i=35:"25 (a)" else: |
| 974 |
decimal(if i>10:i-10 else: i+21 fi) fi) |
| 975 |
if i<8: scaled .7 fi); |
| 976 |
endfor; |
| 977 |
laban=angle(s8l0-s8l5); |
| 978 |
march="$\underbrace{\kern" |
| 979 |
& decimal(arclength(s8l3--s8l5)-5) |
| 980 |
& "bp}_{\hbox{MARCH}}$"; |
| 981 |
april="$\underbrace{\kern" |
| 982 |
& decimal(arclength(s8l0--s8l3)-5) |
| 983 |
& "bp}_{\hbox{APRIL}}$"; |
| 984 |
label(textext(march) rotated laban, |
| 985 |
.5[s8l3,s8l5]+3u*unitvector((s8l0-s8l5) rotated -90)); |
| 986 |
label(textext(april) rotated laban, |
| 987 |
.5[s8l0,s8l3]+3u*unitvector((s8l0-s8l5) rotated -90)); |
| 988 |
enddef; |
| 989 |
|
| 990 |
def draw_easter_table= |
| 991 |
draw_easter_table_slices; |
| 992 |
draw_B_and_C; |
| 993 |
draw_easter_table_labels; |
| 994 |
enddef; |
| 995 |
|
| 996 |
vardef define_dominical_letters= |
| 997 |
save shift; |
| 998 |
pair shift; |
| 999 |
shift=(3u,3u); |
| 1000 |
for i=1 upto 8: |
| 1001 |
col11[i]=whatever[C,.5[s[i]r0,s[i+1]l0]] |
| 1002 |
=whatever[s1r0+shift,s8l0+shift]; |
| 1003 |
endfor; |
| 1004 |
enddef; |
| 1005 |
|
| 1006 |
def draw_labels_col_eleven= |
| 1007 |
for i=1 upto 7: |
| 1008 |
label.ulft(textext(DL(1+(10-i) mod 7)),col11[i]); |
| 1009 |
endfor; |
| 1010 |
label(textext("XI") rotated (angle(s1r0-s8l0)-90), |
| 1011 |
.6[col11[8],col11[7]]); |
| 1012 |
enddef; |
| 1013 |
|
| 1014 |
% define columns 8-11 |
| 1015 |
def define_last_cols= |
| 1016 |
diam2=7u; |
| 1017 |
diam3=13u; |
| 1018 |
for i=1 upto 7: |
| 1019 |
col8[i]=s8l0+(15u,10u+(i-1)*ypart(s1l0-s8l0)/7); |
| 1020 |
col10[i]=col8[i]+(50u,0); |
| 1021 |
endfor; |
| 1022 |
for i=1 upto 13: |
| 1023 |
col9[i]=(xpart(col8[1]+col10[1])/2, |
| 1024 |
ypart(col8[1])+(i-1)*(ypart(col8[7]-col8[1]))/12); |
| 1025 |
endfor; |
| 1026 |
define_dominical_letters; |
| 1027 |
enddef; |
| 1028 |
|
| 1029 |
vardef draw_labels_col_eight_julian= |
| 1030 |
save v; |
| 1031 |
for i=1 upto 7: |
| 1032 |
for j=1 upto 3: |
| 1033 |
v:=((4+i) mod 7)+(j-1)*7; |
| 1034 |
label(textext(decimal(v)) scaled .5, |
| 1035 |
col8[i]-(col_shift_eight_a,0) |
| 1036 |
+((0,1.4u) rotated ((j-1)*120))); |
| 1037 |
endfor; |
| 1038 |
endfor; |
| 1039 |
enddef; |
| 1040 |
|
| 1041 |
def draw_labels_col_eight_gregorian= |
| 1042 |
% the following lines could be parameterized, but it's not worth it |
| 1043 |
secular_year(1,1)(16,20,24); |
| 1044 |
secular_year(1,2)(28,32,36,40); |
| 1045 |
secular_year(1,3)(44,48,52,56); |
| 1046 |
secular_year(1,4)(60,64,68,72); |
| 1047 |
secular_year(1,5)(76,80,84); |
| 1048 |
|
| 1049 |
secular_year(2,1)(17,21); |
| 1050 |
secular_year(2,2)(25,29,33,37); |
| 1051 |
secular_year(2,3)(41,45,49,53); |
| 1052 |
secular_year(2,4)(57,61,65,69); |
| 1053 |
secular_year(2,5)(73,77,81); |
| 1054 |
|
| 1055 |
secular_year(3,1)(18,22); |
| 1056 |
secular_year(3,2)(26,30,34,38); |
| 1057 |
secular_year(3,3)(42,46,50,54); |
| 1058 |
secular_year(3,4)(58,62,66,70); |
| 1059 |
secular_year(3,5)(74,78,82); |
| 1060 |
|
| 1061 |
secular_year(4,1)(15,19,23); |
| 1062 |
secular_year(4,2)(27,31,35,39); |
| 1063 |
secular_year(4,3)(43,47,51,55); |
| 1064 |
secular_year(4,4)(59,63,67,71); |
| 1065 |
secular_year(4,5)(75,79,83); |
| 1066 |
enddef; |
| 1067 |
|
| 1068 |
vardef draw_labels_col_ten= |
| 1069 |
save rbr; |
| 1070 |
rbr=rbox_radius; |
| 1071 |
rbox_radius:=15pt; |
| 1072 |
for i=1 upto 7: |
| 1073 |
rboxit.rb[i](""); |
| 1074 |
rb[i].c=col10[i]; |
| 1075 |
rb[i].dx=9u;rb[i].dy=3.3u; |
| 1076 |
unfill bpath(rb[i]); |
| 1077 |
drawboxes(rb[i]); |
| 1078 |
endfor; |
| 1079 |
rbox_radius:=rbr; |
| 1080 |
|
| 1081 |
yn(1,1)(3,8,14,25,31); |
| 1082 |
yn_left(1)(36,42);yn_right(1)(53,59); |
| 1083 |
yn(1,3)(64,70,81,87,92,98); |
| 1084 |
|
| 1085 |
yn(2,1)(2,13,19,24,30); |
| 1086 |
yn_left(2)(41,47);yn_right(2)(52,58); |
| 1087 |
yn(2,3)(69,75,80,86,97); |
| 1088 |
|
| 1089 |
yn(3,1)(1,7,12,18,29); |
| 1090 |
yn_left(3)(35,40);yn_right(3)(46,57); |
| 1091 |
yn(3,3)(63,68,74,85,91,96); |
| 1092 |
|
| 1093 |
yn(4,1)(0,6,17,23,28); |
| 1094 |
yn_left(4)(34,45);yn_right(4)(51,56); |
| 1095 |
yn(4,3)(62,73,79,84,90); |
| 1096 |
|
| 1097 |
yn(5,1)(5,11,16,22,33); |
| 1098 |
yn_left(5)(39,44);yn_right(5)(50,61); |
| 1099 |
yn(5,3)(67,72,78,89,95); |
| 1100 |
|
| 1101 |
yn(6,1)(4,10,21,27,32); |
| 1102 |
yn_left(6)(38,49);yn_right(6)(55,60); |
| 1103 |
yn(6,3)(66,77,83,88,94); |
| 1104 |
|
| 1105 |
yn(7,1)(9,15,20,26,37); |
| 1106 |
yn_left(7)(43,48);yn_right(7)(54,65); |
| 1107 |
yn(7,3)(71,76,82,93,99); |
| 1108 |
|
| 1109 |
label(textext("X"),col10[1]-(0,10u)); |
| 1110 |
label(textext("$A$") scaled 1.5,col10[7]+2(col8[7]-col8[6])); |
| 1111 |
enddef; |
| 1112 |
|
| 1113 |
def draw_labels_col_ten_a= |
| 1114 |
draw_labels_col_ten; |
| 1115 |
for i=1 upto 7: |
| 1116 |
label.rt(textext(decimal((i+3) mod 7)),col10[i]+10u*right); |
| 1117 |
endfor; |
| 1118 |
enddef; |
| 1119 |
|
| 1120 |
def draw_labels_col_eight_a= |
| 1121 |
draw_labels_col_eight_julian; |
| 1122 |
draw_labels_col_eight_gregorian; |
| 1123 |
label(textext("VIII"),col8[1]-(0,10u)); |
| 1124 |
label(textext("J.C.") scaled 1.5, |
| 1125 |
col8[7]+(-col_shift_eight_a,0)+(col8[7]-col8[6])); |
| 1126 |
label(textext("G.C.") scaled 1.5, |
| 1127 |
col8[7]+(col_shift_eight_b,0)+(col8[7]-col8[6])); |
| 1128 |
enddef; |
| 1129 |
|
| 1130 |
def draw_labels_col_eight_b= |
| 1131 |
for i=1 upto 7: |
| 1132 |
label.top(decimal(i-1),col8[i]); |
| 1133 |
endfor; |
| 1134 |
enddef; |
| 1135 |
|
| 1136 |
def draw_labels_col_nine= |
| 1137 |
for i=1 upto 13: |
| 1138 |
label.rt(textext(DL(1+(3+i) mod 7)),col9[i]); |
| 1139 |
endfor; |
| 1140 |
label(textext("IX"),col9[1]-(0,10u)); |
| 1141 |
label.rt(textext("Dom. L.") rotated 90,col9[1]-(0,10u)); |
| 1142 |
enddef; |
| 1143 |
|
| 1144 |
def draw_labels_col_nine_a= |
| 1145 |
for i=1 upto 13: |
| 1146 |
label.rt(textext(DL(1+(3+i) mod 7) |
| 1147 |
& " ("&decimal((i+3) mod 7)&")"),col9[i]); |
| 1148 |
endfor; |
| 1149 |
label(textext("IX"),col9[1]-(0,10u)); |
| 1150 |
label.rt(textext("Dom. L.") rotated 90,col9[1]-(0,10u)); |
| 1151 |
enddef; |
| 1152 |
|
| 1153 |
def draw_block_five_labels= |
| 1154 |
draw_labels_col_eight_a; |
| 1155 |
draw_labels_col_eight_b; |
| 1156 |
draw_labels_col_nine_a; |
| 1157 |
draw_labels_col_ten_a; |
| 1158 |
enddef; |
| 1159 |
|
| 1160 |
def draw_block_six_labels= |
| 1161 |
draw_labels_col_nine; |
| 1162 |
draw_labels_col_eleven; |
| 1163 |
enddef; |
| 1164 |
|
| 1165 |
def draw_block_seven_labels= |
| 1166 |
draw_labels_col_seven_c; |
| 1167 |
draw_labels_col_eleven; |
| 1168 |
enddef; |
| 1169 |
|
| 1170 |
def draw_all_labels= |
| 1171 |
draw_first_labels; |
| 1172 |
draw_labels_col_eight_julian; |
| 1173 |
draw_labels_col_eight_gregorian; |
| 1174 |
label(textext("VIII"),col8[1]-(0,10u)); |
| 1175 |
draw_labels_col_nine; |
| 1176 |
draw_labels_col_ten; |
| 1177 |
draw_labels_col_eleven; |
| 1178 |
enddef; |
| 1179 |
|
| 1180 |
def draw_block_one_brace= |
| 1181 |
label(textext("$\overbrace{\kern85bp}^{\hbox{Year}}$") scaled 1.5, |
| 1182 |
col2[37]+4(col2[37]-col2[36])); |
| 1183 |
enddef; |
| 1184 |
|
| 1185 |
def draw_col_eight_brace= |
| 1186 |
label(textext("$\overbrace{\kern50bp}^{\hbox{$S$}}$") scaled 1.5, |
| 1187 |
col8[7]+2(col8[7]-col8[6])+(.5(col_shift_eight_b-col_shift_eight_a),0)); |
| 1188 |
enddef; |
| 1189 |
|
| 1190 |
def draw_block_five_braces= |
| 1191 |
draw_col_eight_brace; |
| 1192 |
label(textext("$\overbrace{\kern100bp}^{\hbox{Year}}$") scaled 1.5, |
| 1193 |
col9[13]+6(col9[13]-col9[12]) |
| 1194 |
+(.25(col_shift_eight_b-col_shift_eight_a),0)); |
| 1195 |
enddef; |
| 1196 |
|
| 1197 |
def draw_block_six_brace= |
| 1198 |
draw_col_eight_brace; |
| 1199 |
enddef; |
| 1200 |
|
| 1201 |
def draw_all_braces= |
| 1202 |
draw_block_one_brace; |
| 1203 |
draw_block_five_braces; |
| 1204 |
enddef; |
| 1205 |
|
| 1206 |
def draw_block_one= |
| 1207 |
draw_block_one_example; |
| 1208 |
draw_block_one_circles; |
| 1209 |
draw_block_one_points; % after the circles |
| 1210 |
draw_block_one_labels; |
| 1211 |
draw_block_one_brace; |
| 1212 |
draw_labels_col_two_b; |
| 1213 |
enddef; |
| 1214 |
|
| 1215 |
def draw_block_two= |
| 1216 |
draw_block_two_connections; |
| 1217 |
draw_block_two_example; |
| 1218 |
draw_block_two_points; % after the circles |
| 1219 |
draw_block_two_labels; |
| 1220 |
draw_labels_col_four_c; |
| 1221 |
draw_labels_col_two_c; |
| 1222 |
enddef; |
| 1223 |
|
| 1224 |
def draw_block_three= |
| 1225 |
draw_block_three_example; |
| 1226 |
draw_block_three_circles; |
| 1227 |
draw_block_three_points; % after the circles |
| 1228 |
draw_block_three_labels; |
| 1229 |
enddef; |
| 1230 |
|
| 1231 |
def draw_block_four= |
| 1232 |
draw_block_four_connections; |
| 1233 |
draw_block_four_example; |
| 1234 |
draw_block_four_points; % after the circles |
| 1235 |
draw_block_four_labels; |
| 1236 |
enddef; |
| 1237 |
|
| 1238 |
def draw_block_five= |
| 1239 |
draw_block_five_example; |
| 1240 |
draw_block_five_circles; |
| 1241 |
draw_block_five_labels; |
| 1242 |
draw_block_five_points; % must be after the labels |
| 1243 |
draw_block_five_braces; |
| 1244 |
enddef; |
| 1245 |
|
| 1246 |
def draw_block_six= |
| 1247 |
draw_block_six_connections; |
| 1248 |
draw_block_six_example; |
| 1249 |
draw_block_six_points; % after the example |
| 1250 |
draw_block_six_labels; |
| 1251 |
enddef; |
| 1252 |
|
| 1253 |
def draw_block_seven= |
| 1254 |
draw_block_seven_example; |
| 1255 |
draw_easter_table; % after the example |
| 1256 |
draw_block_seven_labels; |
| 1257 |
draw_block_seven_points; % after the example |
| 1258 |
draw_easter_table_details; |
| 1259 |
enddef; |
| 1260 |
|
| 1261 |
define_first_cols; |
| 1262 |
define_easter_table; |
| 1263 |
define_last_cols; |
| 1264 |
define_col_six_labels; |
| 1265 |
define_col_one_labels; |
| 1266 |
define_col_three_labels; |
| 1267 |
|
| 1268 |
beginfig(1); |
| 1269 |
draw_all_connections; |
| 1270 |
draw_all_example; |
| 1271 |
draw_easter_table; |
| 1272 |
label(textext("\footnotesize "& |
| 1273 |
"\parbox{4cm}{\raggedright "& |
| 1274 |
"Note (a). The Gregorian years which have " & |
| 1275 |
"epact $=$ 25, dominical letter $=$ C, and " & |
| 1276 |
"Golden Number $>$ 11 have their Easter on " & |
| 1277 |
"April 18 instead of April 25. The only such " & |
| 1278 |
"years are 1954, 2049, 2106, 3165, 3260, 3317, "& |
| 1279 |
"3852, 3909, 4004, 6399, etc." & |
| 1280 |
"}"),C+35u*right); |
| 1281 |
|
| 1282 |
draw_all_circles; |
| 1283 |
draw_all_labels; |
| 1284 |
draw_all_points; % after the circles and the labels |
| 1285 |
draw_all_braces; |
| 1286 |
endfig; |
| 1287 |
|
| 1288 |
beginfig(11); |
| 1289 |
draw_block_one; |
| 1290 |
endfig; |
| 1291 |
|
| 1292 |
beginfig(12); |
| 1293 |
draw_block_two; |
| 1294 |
endfig; |
| 1295 |
|
| 1296 |
beginfig(13); |
| 1297 |
draw_block_three; |
| 1298 |
endfig; |
| 1299 |
|
| 1300 |
beginfig(14); |
| 1301 |
draw_block_four; |
| 1302 |
endfig; |
| 1303 |
|
| 1304 |
beginfig(15); |
| 1305 |
draw_block_five; |
| 1306 |
endfig; |
| 1307 |
|
| 1308 |
beginfig(16); |
| 1309 |
draw_block_six; |
| 1310 |
endfig; |
| 1311 |
|
| 1312 |
beginfig(17); |
| 1313 |
draw_block_seven; |
| 1314 |
endfig; |
| 1315 |
|
| 1316 |
beginfig(21); |
| 1317 |
numeric v,w,last; |
| 1318 |
v=10u; |
| 1319 |
w=20u; |
| 1320 |
last=5; |
| 1321 |
pair P[],Q[],R[]; |
| 1322 |
pickup pencircle scaled 2pt; |
| 1323 |
for i=0 upto last: |
| 1324 |
P[i]=(0,i*v);draw P[i]; |
| 1325 |
Q[i]=(2w,i*v);draw Q[i]; |
| 1326 |
endfor; |
| 1327 |
for i=0 upto 2last: |
| 1328 |
R[i]=(w,i*v/2);draw R[i]; |
| 1329 |
endfor; |
| 1330 |
pickup pencircle scaled .5; |
| 1331 |
|
| 1332 |
label.bot(textext("$p_i$"),P0); |
| 1333 |
label.bot(textext("$q_i$"),Q0); |
| 1334 |
label.bot(textext("$r_i$"),R0); |
| 1335 |
draw P2--Q3; |
| 1336 |
for i=0 upto 5: |
| 1337 |
label.lft(textext(decimal i) scaled .7,P[i]); |
| 1338 |
endfor; |
| 1339 |
for i=0 upto 5: |
| 1340 |
label.rt(textext(decimal i) scaled .7,Q[i]); |
| 1341 |
endfor; |
| 1342 |
for i=0 upto 4: |
| 1343 |
label.rt(textext(decimal i) scaled .7,R[i]); |
| 1344 |
endfor; |
| 1345 |
unfill bbox(thelabel.rt(textext("5") scaled .7,R5)); |
| 1346 |
label.rt(textext("5") scaled .7,R5); |
| 1347 |
for i=6 upto 10: |
| 1348 |
label.rt(textext(decimal i) scaled .7,R[i]); |
| 1349 |
endfor; |
| 1350 |
|
| 1351 |
endfig; |
| 1352 |
|
| 1353 |
beginfig(25); |
| 1354 |
numeric v,w,last; |
| 1355 |
v=10u; |
| 1356 |
w=20u; |
| 1357 |
last=5; |
| 1358 |
pair P[],Q[],R[]; |
| 1359 |
pickup pencircle scaled 2pt; |
| 1360 |
for i=0 upto last: |
| 1361 |
P[i]=(0,i*v);draw P[i]; |
| 1362 |
Q[i]=(2w,i*v);draw Q[i]; |
| 1363 |
endfor; |
| 1364 |
for i=0 upto 2last: |
| 1365 |
R[i]=(w,i*v/2);draw R[i]; |
| 1366 |
endfor; |
| 1367 |
pickup pencircle scaled .5; |
| 1368 |
|
| 1369 |
label.bot(textext("$p_i$"),P0); |
| 1370 |
label.bot(textext("$q_i$"),Q0); |
| 1371 |
label.bot(textext("$r_i$"),R0); |
| 1372 |
draw P2--Q3; |
| 1373 |
for i=0 upto 5: |
| 1374 |
label.lft(textext("$x_" & decimal i & "$") scaled .7,P[i]); |
| 1375 |
endfor; |
| 1376 |
for i=0 upto 5: |
| 1377 |
label.rt(textext("$y_" & decimal i & "$") scaled .7,Q[i]); |
| 1378 |
endfor; |
| 1379 |
for i=0 upto 4: |
| 1380 |
label.rt(textext("$z_" & decimal i & "$") scaled .7,R[i]); |
| 1381 |
endfor; |
| 1382 |
unfill bbox(thelabel.rt(textext("$z_5$") scaled .7,R5)); |
| 1383 |
label.rt(textext("$z_5$") scaled .7,R5); |
| 1384 |
for i=6 upto 10: |
| 1385 |
label.rt(textext("$z_{" & decimal i & "}$") scaled .7,R[i]); |
| 1386 |
endfor; |
| 1387 |
|
| 1388 |
endfig; |
| 1389 |
|
| 1390 |
|
| 1391 |
|
| 1392 |
end |