dim m(14),yn(100),num(32) as string dim mc(14),md(14),yc(100),ccg(100),ccj(100),mml,day,a,b,r as double mml=29.53058867 day=1/mml k=5 km=.689529644 'corr months 'Establish the 5 standard line thicknesses in thousands of an inch. dcSetDrawingData dcLineThin, .003 dcSetDrawingData dcLineNormal, .008 dcSetDrawingData dcLineThick, .012 dcSetDrawingData dcLineHeavy, .024 dcSetDrawingData dcLineWide, .048 dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetCircleParms dcBLACK, dcSOLID, dcTHIN 'Maximize the window, close any existing drawing without saving, and start a new drawing. dcSetDrawingWindowMode dcMaximizeWin dcCloseWithoutSaving dcNew "" dcSetLineParms dcBLACK, dcSOLID, dcNormal dcCreateLine 0,0,k,0 dcCreateLine k,0,k,k dcCreateLine k*1.05,k,0,k dcCreateLine 0,k,0,0 for i=0 to 31 if i mod 4 = 0 then dcSetLineParms dcBLACK, dcSOLID, dcNormal end if dcCreateLine k*i/32,0,k,k*(1-i/32) dcSetLineParms dcBLACK, dcSOLID, dcThin next i for i=0 to 31 if i mod 4 = 0 then dcSetLineParms dcBLACK, dcSOLID, dcNormal end if dcCreateLine 0,k*i/32,k*(1-i/32),k dcSetLineParms dcBLACK, dcSOLID, dcThin next i dcSetLineParms dcBLACK, dcSOLID, dcThin m( 1)="JAN" m( 2)="Mar" m( 3)="Jan" m( 4)="FEB" m( 5)="Apr" m( 6)="Feb" m( 7)="May" m( 8)="Jun" m( 9)="Jul" m(10)="Aug" m(11)="Sep" m(12)="Oct" m(13)="Nov" m(14)="Dec" md( 1)=0 md( 2)=60 md( 3)=1 md( 4)=31 md( 5)=91 md( 6)=32 md( 7)=121 md( 8)=152 md( 9)=182 md(10)=213 md(11)=244 md(12)=274 md(13)=305 md(14)=335 for i=1 to 14 mc(i)=(md(i)-int(md(i)/mml)*mml)/mml next i dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetTextParms dcBlack, "Tahoma","Standard",0,10,6,0,0 for i=1 to 14 if i=1 or i=4 then dcSetLineParms dcRED, dcSOLID, dcTHIN dcSetTextParms dcRED, "Tahoma","Bold",0,10,6,0,0 end if dcCreateLine 0,k*(km-mc(i)),-.1,k*(km-mc(i)) dcCreateLine -.1,k*(km-mc(i)),-.2,k*(km-.344*(i-1)/13) dcCreateText -.22,k*(km-.344*(i-1)/13),0,m(i) dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetTextParms dcBlack, "Tahoma","Standard",0,10,6,0,0 next i for i=0 to 99 if i<10 then yn(i)="0"+CStr(i) else yn(i)=CStr(i) end if a=365*i +Int(i/4) yc(i)=(a-Int(a/mml)*mml)/mml a=36524*(i-20)+Int((i-20)/4) ccg(i)=(a-Int(a/mml)*mml)/mml a=36525*(i-20)+13 ccj(i)=(a-Int(a/mml)*mml)/mml next i 'move by +/-.5 to fit the months better for i=0 to 99 yc(i)=yc(i)+.5 if yc(i)>=1 then yc(i)=yc(i)-1 next i dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 for i=0 to 99 if yn(i) mod 4=0 then dcSetLineParms dcRED, dcSOLID, dcTHIN dcSetTextParms dcRED, "Tahoma","Bold",0,10,5,0,0 end if dcCreateLine k*yc(i),k,k*yc(i),k*1.03+i*.01 dcCreateText k*yc(i),k*1.05+i*.01,0,yn(i) dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 next i dcSetTextParms dcBlack, "Tahoma","Bold",0,16,5,0,0 dcCreateText k*.5,k*1.4,0,"MOON PHASE CALENDAR" dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 dcCreateText k*.5,1.350*k,0,"Author: Valentin Hristov, Sofia, Bulgaria" dcCreateText k*.5,1.325*k,0,"E-mail: valhrist@bas.bg, valhrist@gmail.com" dcSetTextParms dcBlack, "Tahoma","Standard",0,9,5,0,0 dcCreateText k*.50,1.300*k,0,"Web page: www.math.bas.bg/complan/valhrist/mystuff.htm" for i=1 to 31 num(i)=CStr(i) next i dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 for i=1 to 30 dcSetLineParms dcBLACK, dcSOLID, dcNormal if i<30 then dcCreateLine 0,k*(1-day*i),k*1.05,k*(1-day*i) end if dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine 0,k*(1-day*(i-.5)),k*1.025,k*(1-day*(i-.5)) if i<30 then dcSetLineParms dcBLACK, dcSOLID, dcNormal dcCreateLine k*day*i,0,k*day*i,k dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine k*(day*(i-.5)),0,k*(day*(i-.5)),k end if if i>28 then dcSetTextParms dcDarkGreen, "Tahoma","Bold",0,10,5,0,0 end if dcCreateText k*1.04,k*(1-day*(i-.5)),90,num(i) dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 next i for i=30 to 31 dcSetLineParms dcBLACK, dcSOLID, dcNormal dcCreateLine 0,k*(2-day*i),k*1.08,k*(2-day*i) dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine 0,k*(2-day*(i-.5)),k*1.065,k*(2-day*(i-.5)) dcSetTextParms dcDarkGreen, "Tahoma","Bold",0,10,5,0,0 dcCreateText k*1.08,k*(2-day*(i-.5)),90,num(i) dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 next i dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 for i=15 to 40 if i mod 4=0 then dcSetLineParms dcRED, dcSOLID, dcTHIN dcSetTextParms dcRED, "Tahoma","Bold",0,10,5,0,0 end if dcCreateLine k*ccg(i),0,k*ccg(i),-k*.03-i*.015+.3 dcCreateText k*ccg(i),-k*.05-i*.015+.3,0,yn(i) dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 next i dcSetLineParms dcRED, dcSOLID, dcTHIN dcSetTextParms dcRED, "Tahoma","Bold",0,10,5,0,0 for i=0 to 40 dcCreateLine k*ccj(i),0,k*ccj(i),-k*.13-i*.015 dcCreateText k*ccj(i),-k*.15-i*.015,0,yn(i) next i dcSetCircleParms dcBlack,dcFill,dcThin for i=0 to 2 dcCreateCircle k*i*.5,k*(2-i)*.5,k*.025 next i dcSetCircleParms dcBlack,dcSolid,dcNormal for i=1 to 7 dcCreateCircle k*i*.125,k*(8-i)*.125,k*.025 next i dcSetCircleParms dcBlack,dcFill,dcThin dcCreateCircleEx k*.125,k*.875,k*.125,k*.9,k*.125,k*.85,k*.025,k*.025,0,0 dcCreateCircleEx k*.625,k*.375,k*.625,k*.4,k*.625,k*.35,k*.025,k*.025,0,0 dcCreateCircleEx k*.375,k*.625,k*.375,k*.6,k*.375,k*.65,k*.025,k*.025,0,0 dcCreateCircleEx k*.875,k*.125,k*.875,k*.1,k*.875,k*.15,k*.025,k*.025,0,0 dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine 0,-.12*k,k,-.12*k dcCreateLine 0,-.28*k,k,-.28*k dcSetTextParms dcBlack, "Tahoma","Bold",0,10,5,0,0 dcCreateText .23*k,-.02*k,0,"Gregorian" dcCreateText .72*k,-.142*k,0,"Julian" dcSetTextParms dcBlack, "Tahoma","Standard",0,9,4,0,0 dcCreateText 0,-.325*k,0,"INSTRUCTION FOR USE" dcCreateText 0,-.375*k,0,"For January and February in LEAP years (BOLD) use JAN and FEB (CAPITAL)." dcCreateText 0,-.425*k,0,"For YEARS BETWEEN 2000 AND 2099 GREGORIAN (NEW) STYLE make the following:" dcCreateText 0,-.450*k,0,"1. Find the intersection point of the horizontal segment from the month and the vertical" dcCreateText 0,-.475*k,0," segment from the year in the century - Point 1." dcCreateText 0,-.500*k,0,"2. Follow the diagonal direction from Point 1 to the intersection with one of the HORIZONTAL" dcCreateText 0,-.525*k,0," boundaries of the square - Point 2." dcCreateText 0,-.550*k,0,"3. The vertical segment through Point 2 intersects the horizontal segment from the date at" dcCreateText 0,-.575*k,0," Point 3, which lies on the diagonal line indicating the MEAN MOON PHASE." dcCreateText 0,-.625*k,0,"The result could differ from the REAL MOON PHASE by +/- one day." dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine .1*k,-.9*k,.3*k,-.9*k dcCreateLine .3*k,-.9*k,.3*k,-.7*k dcCreateLine .3*k,-.7*k,.1*k,-.7*k dcCreateLine .1*k,-.7*k,.1*k,-.9*k dcCreateLine .1*k,-.9*k,.3*k,-.7*k dcSetLineParms dcRED, dcSOLID, dcThin dcCreateLine .05*k,-.8*k,.15*k,-.8*k dcCreateLine .15*k,-.8*k,.15*k,-.65*k dcSetLineParms dcBLUE, dcSOLID, dcThin dcCreateLine .15*k,-.8*k,.25*k,-.7*k dcSetLineParms dcGREEN, dcSOLID, dcThin dcCreateLine .25*k,-.7*k,.25*k,-.9*k dcCreateLine .25*k,-.825*k,.35*k,-.825*k dcCreateText .15*k,-.8*k,0,"1" dcCreateText .25*k,-.7*k,0,"2" dcCreateText .25*k,-.825*k,0,"3" dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine .7*k,-.9*k,.9*k,-.9*k dcCreateLine .9*k,-.9*k,.9*k,-.7*k dcCreateLine .9*k,-.7*k,.7*k,-.7*k dcCreateLine .7*k,-.7*k,.7*k,-.9*k dcCreateLine .7*k,-.9*k,.9*k,-.7*k dcSetLineParms dcRED, dcSOLID, dcThin dcCreateLine .65*k,-.8*k,.85*k,-.8*k dcCreateLine .85*k,-.8*k,.85*k,-.65*k dcSetLineParms dcBLUE, dcSOLID, dcThin dcCreateLine .85*k,-.8*k,.75*k,-.9*k dcSetLineParms dcGREEN, dcSOLID, dcThin dcCreateLine .75*k,-.7*k,.75*k,-.9*k dcCreateLine .75*k,-.775*k,.95*k,-.775*k dcCreateText .85*k,-.8*k,0,"1" dcCreateText .75*k,-.9*k,0,"2" dcCreateText .75*k,-.775*k,0,"3" dcSetTextParms dcBlack, "Tahoma","Standard",0,9,4,0,0 dcCreateText 0, -.950*k,0,"For YEARS IN OTHER CENTURIES and for the JULIAN (OLD) STYLE start with modifying the" dcCreateText 0, -.975*k,0," position of the horizontal segment for the month as follows:" dcCreateText 0,-1.000*k,0,"0-1. Find the intersection point of the horizontal segment from the month and the vertical" dcCreateText 0,-1.025*k,0," segment from the the full century - Point A." dcCreateText 0,-1.050*k,0,"0-2. Follow the diagonal direction from Point A to the intersection with one of the VERTICAL" dcCreateText 0,-1.075*k,0," boundaries of the square - Point B." dcCreateText 0,-1.100*k,0,"0-3. Now the horizontal segment through Point B is the modified position corresponding to" dcCreateText 0,-1.125*k,0," the month." dcCreateText 0,-1.150*k,0,"Then proceed as above (1.,2.,3.)." dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine .1*k,-1.4*k,.3*k,-1.4*k dcCreateLine .3*k,-1.4*k,.3*k,-1.2*k dcCreateLine .3*k,-1.2*k,.1*k,-1.2*k dcCreateLine .1*k,-1.2*k,.1*k,-1.4*k dcCreateLine .1*k,-1.4*k,.3*k,-1.2*k dcSetLineParms dcPURPLE, dcSOLID, dcThin dcCreateLine .05*k,-1.3*k,.175*k,-1.3*k dcCreateLine .175*k,-1.3*k,.175*k,-1.45*k dcSetLineParms dcBROWN, dcSOLID, dcThin dcCreateLine .175*k,-1.3*k,.1*k,-1.375*k dcSetLineParms dcRED, dcSOLID, dcThin dcCreateLine .05*k,-1.375*k,.3*k,-1.375*k dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 dcCreateText .175*k,-1.3*k,0,"A" dcCreateText .1*k,-1.375*k,0,"B" dcSetLineParms dcBLACK, dcSOLID, dcThin dcCreateLine .7*k,-1.4*k,.9*k,-1.4*k dcCreateLine .9*k,-1.4*k,.9*k,-1.2*k dcCreateLine .9*k,-1.2*k,.7*k,-1.2*k dcCreateLine .7*k,-1.2*k,.7*k,-1.4*k dcCreateLine .7*k,-1.4*k,.9*k,-1.2*k dcSetLineParms dcPURPLE, dcSOLID, dcThin dcCreateLine .65*k,-1.3*k,.85*k,-1.3*k dcCreateLine .85*k,-1.3*k,.85*k,-1.45*k dcSetLineParms dcBROWN, dcSOLID, dcThin dcCreateLine .85*k,-1.3*k,.9*k,-1.25*k dcSetLineParms dcRED, dcSOLID, dcThin dcCreateLine .65*k,-1.25*k,.9*k,-1.25*k dcSetTextParms dcBlack, "Tahoma","Standard",0,10,5,0,0 dcCreateText .85*k,-1.3*k,0,"A" dcCreateText .9*k,-1.25*k,0,"B"