' STARS CLOCK (for the Northern Hemisphere) ' Author: Valentin Hristov (valhrist@bas.bg) ' Variant for testing. ' The data contains 90 brightest stars (magn <= 2.5) but only those from the ' Northern Hemisphere are shown. Modifications can be made to show ' the Southern Hemisphere. ' Print two copies of the picture and cut them along the two outermost circles. ' Put the time (standard or daylight savings) against the date and ' rotate both disks together making vertical the two line marks for the ' local meridian on the outside annulus (21 March down). ' Thus you have the view of the sky, looking to the North. ' The opposite is more interesting. Use the real view with properly ' adjusted vertical direction and find the time against the date. ' Special marks for the location are made. My longitude (Sofia-Bulgaria) ' is 23.5 degrees East. You can put the values for your location in ' the dialog boxes. East longitude is positive. Option Explicit ' Force all variables to be declared before they are used. No adhoc variables Dim br(98),ra(98),de(98),xx(21),yy(21),m(21),pi,r,x,y,a,lo,cm,ll as double Dim i as integer Dim mm(12),p,outtext,action,button As String Dim inputcorrect As boolean 'INITIAL DATA 'p="Sofia"'Place 'lo=23.5 'Longitude (decimal degrees, East is positive) 'cm=30 'Central meridian of the time zone (decimal degrees, E is positive) dcSetDrawingWindowMode dcMaximizeWin dcCloseWithoutSaving dcNew "" dcSetDrawingScale 25.4 'Calculate in millimeters '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 pi=4*Atn(1) Initial_Data dcSetLineParms dcBlack, dcSOLID, dcThick dcCreateLine -30,0,30,0 dcCreateLine 0,-30,0,30 dcSetLineParms dcBLACK, dcSOLID, dcTHIN dcSetCircleParms dcBLACK, dcSOLID, dcTHIN for i = 30 to 90 step 30 dcCreateCircle 0,0,i next i dcCreateCircle 0,0,107 for i = 0 to 23 ' hour marks x=15*cos(i*pi/12) y=-15*sin(i*pi/12) dcCreateLine x,y,5.2*x,5.2*y dcSetTextParms dcBlack, "Times New Roman","Standard",90-i*15,10,5,0,0 dcCreateText x*5.7,y*5.7,0,CStr(i) dcSetTextParms dcBlack, "Times New Roman","Standard",90-i*15,10,5,0,0 dcCreateText x*5.4,y*5.4,0,CStr(i+1) next i for i = 0 to 144 ' 10 min marks x=90*cos(i*pi/72) y=-90*sin(i*pi/72) dcCreateLine x,y,.98*x,.98*y next i for i=0 to 364 ' date marks x=90*cos(i*2*pi/365) y=-90*sin(i*2*pi/365) dcCreateLine x,y,1.02*x,1.02*y next i m(1)=0:mm(1)="1 Jan" m(2)=31:mm(2)="1 Feb" m(3)=59:mm(3)="1 Mar" m(4)=90:mm(4)="1 Apr" m(5)=120:mm(5)="1 May" m(6)=151:mm(6)="1 Jun" m(7)=181:mm(7)="1 Jul" m(8)=212:mm(8)="1 Aug" m(9)=243:mm(9)="1 Sep" m(10)=273:mm(10)="1 Oct" m(11)=304:mm(11)="1 Nov" m(12)=334:mm(12)="1 Dec" for i=1 to 12 x=90*cos(m(i)*2*pi/365) y=90*sin(m(i)*2*pi/365) dcCreateLine x,y,1.05*x,1.05*y ' 1-st of the month dcSetTextParms dcBlack, "Times New Roman","Standard",90+m(i),10,4,0,0 dcCreateText x*1.08,y*1.08,0,mm(i) x=90*cos((m(i)+5)*2*pi/365) ' 6-th of the month y=90*sin((m(i)+5)*2*pi/365) dcCreateLine x,y,1.04*x,1.04*y dcSetTextParms dcBlack, "Times New Roman","Standard",90+m(i)+5*360/365,6,4,0,0 dcCreateText x*1.06,y*1.06,0,"6" x=90*cos((m(i)+10)*2*pi/365) ' 11-th of the month y=90*sin((m(i)+10)*2*pi/365) dcCreateLine x,y,1.04*x,1.04*y dcSetTextParms dcBlack, "Times New Roman","Standard",90+m(i)+10*360/365,6,4,0,0 dcCreateText x*1.06,y*1.06,0,"11" x=90*cos((m(i)+15)*2*pi/365) ' 16-th of the month y=90*sin((m(i)+15)*2*pi/365) dcCreateLine x,y,1.04*x,1.04*y dcSetTextParms dcBlack, "Times New Roman","Standard",90+m(i)+15*360/365,6,4,0,0 dcCreateText x*1.06,y*1.06,0,"16" x=90*cos((m(i)+20)*2*pi/365) ' 21-th of the month y=90*sin((m(i)+20)*2*pi/365) dcCreateLine x,y,1.04*x,1.04*y dcSetTextParms dcBlack, "Times New Roman","Standard",90+m(i)+20*360/365,6,4,0,0 dcCreateText x*1.06,y*1.06,0,"21" x=90*cos((m(i)+25)*2*pi/365) ' 26-st of the month y=90*sin((m(i)+25)*2*pi/365) dcCreateLine x,y,1.04*x,1.04*y dcSetTextParms dcBlack, "Times New Roman","Standard",90+m(i)+25*360/365,6,4,0,0 dcCreateText x*1.06,y*1.06,0,"26" next i dcSetLineParms dcBlack, dcSOLID, dcHeavy x=107*cos(100.375*pi/180) ' vertical marks for central meridian y=-107*sin(100.375*pi/180) dcCreateLine x,y,.96*x,.96*y dcCreateLine -x,-y,-.96*x,-.96*y dcSetTextParms dcBlack,"Times New Roman","Bold",-90-100.375,8,5,0,0 dcCreateText x*.98,y*.98,0," Gree nwich" dcCreateText -x*.98,-y*.98,0," Gree nwich" dcSetLineParms dcBlack, dcSOLID, dcThick ll=100.375+lo-cm-(cm+7.5)/360*0.985647 'corrected for difference with GMT x=90*cos(ll*pi/180) ' vertical marks for the location y=-90*sin(ll*pi/180) dcCreateLine x,y,1.1*x,1.1*y dcCreateLine -x,-y,-1.1*x,-1.1*y dcSetTextParms dcBlack, "Times New Roman","Standard",-90-ll,10,5,0,0 dcCreateText x*1.12,y*1.12,0,p dcCreateText -x*1.12,-y*1.12,0,p br(1) = -1.46: ra(1) = 6.7525: de(1) = -16.7161 br(2) = -0.72: ra(2) = 6.3992: de(2) = -52.6956 br(3) = -0.01: ra(3) = 14.6601: de(3) = -60.8353 br(4) = -0.04: ra(4) = 14.2610: de(4) = 19.1825 br(5) = 0.03: ra(5) = 18.6156: de(5) = 38.7836 br(6) = 0.08: ra(6) = 5.2781: de(6) = 45.9981 br(7) = 0.12: ra(7) = 5.2423: de(7) = -8.2017 br(8) = 0.38: ra(8) = 7.6550: de(8) = 5.2250 br(9) = 0.46: ra(9) = 1.6286: de(9) = -57.2367 br(10) = 0.50: ra(10) = 5.9195: de(10) = 7.4069 br(11) = 0.61: ra(11) = 14.0637: de(11) = -60.3728 br(12) = 0.77: ra(12) = 19.8464: de(12) = 8.8668 br(13) = 0.85: ra(13) = 4.5987: de(13) = 16.5092 br(14) = 0.98: ra(14) = 13.4199: de(14) = -11.1614 br(15) = 0.96: ra(15) = 16.4901: de(15) = -26.4236 br(16) = 1.14: ra(16) = 7.7553: de(16) = 28.0261 br(17) = 1.16: ra(17) = 22.9608: de(17) = -29.6222 br(18) = 1.25: ra(18) = 20.6905: de(18) = 45.2803 br(19) = 1.25: ra(19) = 12.7954: de(19) = -59.6886 br(20) = 1.35: ra(20) = 10.1395: de(20) = 11.9672 br(21) = 1.50: ra(21) = 6.9771: de(21) = -28.9722 br(22) = 1.58: ra(22) = 12.4433: de(22) = -63.0989 br(23) = 1.58: ra(23) = 7.5766: de(23) = 31.8883 br(24) = 1.63: ra(24) = 12.5194: de(24) = -57.1131 br(25) = 1.63: ra(25) = 17.5601: de(25) = -37.1036 br(26) = 1.64: ra(26) = 5.4188: de(26) = 6.3497 br(27) = 1.65: ra(27) = 5.4382: de(27) = 28.6075 br(28) = 1.68: ra(28) = 9.2200: de(28) = -69.7172 br(29) = 1.70: ra(29) = 5.6035: de(29) = -1.2019 br(30) = 1.74: ra(30) = 22.1372: de(30) = -46.9611 br(31) = 1.77: ra(31) = 12.9005: de(31) = 55.9597 br(32) = 1.78: ra(32) = 8.1589: de(32) = -47.3367 br(33) = 1.79: ra(33) = 3.4054: de(33) = 49.8614 br(34) = 1.79: ra(34) = 11.0621: de(34) = 61.7508 br(35) = 1.84: ra(35) = 7.1398: de(35) = -26.3931 br(36) = 1.85: ra(36) = 18.4029: de(36) = -34.3847 br(37) = 1.86: ra(37) = 8.3752: de(37) = -59.5094 br(38) = 1.86: ra(38) = 13.7923: de(38) = 49.3133 br(39) = 1.87: ra(39) = 17.6219: de(39) = -42.9978 br(40) = 1.90: ra(40) = 5.9921: de(40) = 44.9475 br(41) = 1.92: ra(41) = 16.8111: de(41) = -69.0278 br(42) = 1.93: ra(42) = 6.6285: de(42) = 16.3992 br(43) = 1.94: ra(43) = 20.4274: de(43) = -56.7353 br(44) = 1.96: ra(44) = 8.7451: de(44) = -54.7083 br(45) = 1.98: ra(45) = 6.3783: de(45) = -17.9561 br(46) = 1.98: ra(46) = 9.4598: de(46) = -8.6586 br(47) = 2.00: ra(47) = 2.1195: de(47) = 23.4625 br(48) = 2.00: ra(48) = 15.9917: de(48) = 25.9203 br(49) = 2.02: ra(49) = 2.5307: de(49) = 89.2642 br(50) = 2.02: ra(50) = 18.9211: de(50) = -26.2967 br(51) = 2.04: ra(51) = 0.7265: de(51) = -17.9867 br(52) = 2.05: ra(52) = 5.6793: de(52) = -1.9428 br(53) = 2.06: ra(53) = 0.1398: de(53) = 29.0906 br(54) = 2.06: ra(54) = 1.1622: de(54) = 35.6206 br(55) = 2.06: ra(55) = 2.0650: de(55) = 42.3297 br(56) = 2.06: ra(56) = 14.1113: de(56) = -36.3700 br(57) = 2.06: ra(57) = 5.7959: de(57) = -9.6697 br(58) = 2.08: ra(58) = 17.5822: de(58) = 12.5600 br(59) = 2.08: ra(59) = 14.8451: de(59) = 74.1556 br(60) = 2.10: ra(60) = 22.7111: de(60) = -46.8847 br(61) = 2.12: ra(61) = 3.1361: de(61) = 40.9558 br(62) = 2.14: ra(62) = 11.8176: de(62) = 14.5719 br(63) = 2.17: ra(63) = 12.6919: de(63) = -48.9594 br(64) = 2.20: ra(64) = 20.3704: de(64) = 40.2567 br(65) = 2.21: ra(65) = 9.1333: de(65) = -43.4200 br(66) = 2.23: ra(66) = 0.6751: de(66) = 56.5375 br(67) = 2.23: ra(67) = 15.5781: de(67) = 26.7147 br(68) = 2.23: ra(68) = 17.9434: de(68) = 51.4889 br(69) = 2.23: ra(69) = 5.5334: de(69) = 0.0000 br(70) = 2.25: ra(70) = 0.1529: de(70) = 59.1497 br(71) = 2.25: ra(71) = 9.2848: de(71) = -59.2753 br(72) = 2.25: ra(72) = 8.0597: de(72) = -40.0031 br(73) = 2.27: ra(73) = 13.3988: de(73) = 54.9253 br(74) = 2.29: ra(74) = 16.8360: de(74) = -34.2933 br(75) = 2.30: ra(75) = 14.6988: de(75) = -47.3881 br(76) = 2.30: ra(76) = 13.6648: de(76) = -53.4664 br(77) = 2.31: ra(77) = 14.5918: de(77) = -42.1578 br(78) = 2.32: ra(78) = 16.0055: de(78) = -22.6217 br(79) = 2.37: ra(79) = 11.0307: de(79) = 56.3822 br(80) = 2.39: ra(80) = 0.4381: de(80) = -42.3061 br(81) = 2.39: ra(81) = 21.7364: de(81) = 9.8750 br(82) = 2.41: ra(82) = 17.7081: de(82) = -39.0300 br(83) = 2.42: ra(83) = 23.0629: de(83) = 28.0828 br(84) = 2.44: ra(84) = 21.3096: de(84) = 62.5856 br(85) = 2.44: ra(85) = 11.8972: de(85) = 53.6947 br(86) = 2.45: ra(86) = 7.4016: de(86) = -29.3031 br(87) = 2.46: ra(87) = 20.7702: de(87) = 33.9703 br(88) = 2.47: ra(88) = 0.9451: de(88) = 60.7167 br(89) = 2.49: ra(89) = 23.0793: de(89) = 15.2053 br(90) = 2.50: ra(90) = 9.3686: de(90) = 55.0106 ' Additional stars for drawing the constelations br(91) = 3.27: ra(91) = 12.2366: de(91) = 57.1714 br(92) = 2.68: ra(92) = 1.4027: de(92) = 60.1058 br(93) = 3.38: ra(93) = 1.8763: de(93) = 63.5478 br(94) = 4.36: ra(94) = 17.5367: de(94) = 86.585 br(95) = 4.23: ra(95) = 16.765: de(95) = 82.0367 br(96) = 4.32: ra(96) = 15.7333: de(96) = 77.7933 br(97) = 3.05: ra(97) = 15.345: de(97) = 71.8333 br(98) = 4.95: ra(98) = 16.2917: de(98) = 75.755 '********************** dcSetCircleParms dcBLACK, dcFILL for i=1 to 98 r=90-de(i) if r<=90 then x=r*cos(ra(i)*pi/12) y=-r*sin(ra(i)*pi/12) dcCreateCircle x,y,1.7-br(i)/4 if i=38 then xx(1)=x:yy(1)=y 'Ursa Major if i=73 then xx(2)=x:yy(2)=y if i=31 then xx(3)=x:yy(3)=y if i=91 then xx(4)=x:yy(4)=y:xx(8)=x:yy(8)=y if i=34 then xx(5)=x:yy(5)=y if i=79 then xx(6)=x:yy(6)=y if i=85 then xx(7)=x:yy(7)=y if i=70 then xx(9)=x:yy(9)=y 'Cassiopea if i=66 then xx(10)=x:yy(10)=y if i=88 then xx(11)=x:yy(11)=y if i=92 then xx(12)=x:yy(12)=y if i=93 then xx(13)=x:yy(13)=y if i=49 then xx(14)=x:yy(14)=y 'Ursa Minor if i=94 then xx(15)=x:yy(15)=y if i=95 then xx(16)=x:yy(16)=y if i=96 then xx(17)=x:yy(17)=y:xx(21)=x:yy(21)=y if i=59 then xx(18)=x:yy(18)=y if i=97 then xx(19)=x:yy(19)=y if i=98 then xx(20)=x:yy(20)=y end if next count dcSetLineParms dcBLACK, dcSOLID, dcNORMAL for i=1 to 7 'Ursa Major dcCreateLine xx(i),yy(i),xx(i+1),yy(i+1) next i for i=9 to 12 'Cassiopea dcCreateLine xx(i),yy(i),xx(i+1),yy(i+1) next i for i=14 to 20 'Ursa Minor dcCreateLine xx(i),yy(i),xx(i+1),yy(i+1) next i Sub Initial_Data Begin Dialog CONSTANTS_INPUT 13,1,200,85,"Initial data" Text 15,0,300,10, "STAR CLOCK FOR THE NORTHERN HEMISPHERE" Text 15,8,150,10, "with standard and daylight savings time" Text 15,16,150,10, "and correction for the longitude" Text 15,28,150,10, "Location" Text 15,40,150,10, "Longitude (decimal degrees, E is >0)" Text 15,52,150,10, "Central meridian of the time zone" TextBox 88,28,99,10, .p TextBox 150,40,37,10, .lo TextBox 150,52,37,10, .cm OKButton 82,70,37,12 End Dialog Dim prompt As CONSTANTS_INPUT prompt.p = "Sofia" prompt.lo = 23.5 prompt.cm = 30 repeat_until_inputcorrect: 'label to return if input is not correct action = Dialog(prompt) 'get the input If test("lo",prompt.lo,-180,180) = false Then GoTo repeat_until_inputcorrect End If If test("cm",prompt.cm,-180,180) = false Then GoTo repeat_until_inputcorrect End If p = prompt.p lo = prompt.lo cm = prompt.cm End Sub Function test(varname,x,minval,maxval) As boolean If IsNumeric(x) = false Then test = false outtext = varname & " must be numeric" MsgBox outtext exit Function End If If x < minval Or x > maxval Then outtext = varname & " must be between " & chr$(13) & minval & " and " & maxval MsgBox outtext exit Function End If test = true End Function