ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

182 lines
5.2 KiB

  1. 100 REM PROGRAM FOR POINTING A TELESCOPE
  2. 105 REM BY T. TAKI
  3. 110 REM
  4. 111 REM
  5. 115 DIM S$(17),B(17),D(17),Q(3,3)
  6. 120 DIM V(3,3),R(3,3),X(3,3),Y(3,3)
  7. 125 REM
  8. 130 REM STAR DATA
  9. 135 FOR J=1 TO 17: READ S$(J),B(J),D(J): NEXT J
  10. 140 REM
  11. 145 REM CONSTANTS
  12. 150 K=1.002738: G=57.2958
  13. 155 Z1=0: Z2=0: Z3=0: REM MOUNT ERROR, IF ANY <<<<<<<<<
  14. 160 REM
  15. 165 FOR I=1 TO 2
  16. 166 PRINT
  17. 170 INPUT "NAME OF BASIC STAR ";S$(0)
  18. 175 INPUT "TIME (MIN) ";T
  19. 180 INPUT "TELESCOPE DIRECTION ";F
  20. 185 INPUT "TELESCOPE ELEVATION ";H
  21. 195 N=0
  22. 200 N=N+1: IF S$(0)=S$(N) THEN 215
  23. 205 IF N=17 THEN 170
  24. 210 GOTO 200
  25. 215 D(0)=D(N)/G: B(0)=(B(N)-K*T*0.25)/G
  26. 220 X(1,I)=COS(D(0))*COS(B(0))
  27. 225 X(2,I)=COS(D(0))*SIN(B(0))
  28. 230 X(3,I)=SIN(D(0))
  29. 235 F=F/G: H=(H+Z3)/G: GOSUB 750
  30. 240 Y(1,I)=Y(1,0): Y(2,I)=Y(2,0): Y(3,I)=Y(3,0)
  31. 245 NEXT I
  32. 250 REM
  33. 255 X(1,3)=X(2,1)*X(3,2)-X(3,1)*X(2,2)
  34. 260 X(2,3)=X(3,1)*X(1,2)-X(1,1)*X(3,2)
  35. 265 X(3,3)=X(1,1)*X(2,2)-X(2,1)*X(1,2)
  36. 270 A=SQR(X(1,3)^2+X(2,3)^2+X(3,3)^2)
  37. 275 FOR I=1 TO 3: X(I,3)=X(I,3)/A: NEXT I
  38. 280 REM
  39. 285 Y(1,3)=Y(2,1)*Y(3,2)-Y(3,1)*Y(2,2)
  40. 290 Y(2,3)=Y(3,1)*Y(1,2)-Y(1,1)*Y(3,2)
  41. 295 Y(3,3)=Y(1,1)*Y(2,2)-Y(2,1)*Y(1,2)
  42. 300 A=SQR(Y(1,3)^2+Y(2,3)^2+Y(3,3)^2)
  43. 305 FOR I=1 TO 3: Y(I,3)=Y(I,3)/A: NEXT I
  44. 310 REM
  45. 311 REM
  46. 315 REM TRANSFORM MATRIX
  47. 320 FOR I=1 TO 3: FOR J=1 TO 3
  48. 325 V(I,J)=X(I,J)
  49. 330 NEXT J: NEXT I
  50. 335 GOSUB 650: E=W
  51. 340 REM
  52. 345 FOR M=1 TO 3: FOR I=1 TO 3: FOR J=1 TO 3
  53. 350 V(I,J)=X(I,J)
  54. 355 NEXT J: NEXT I
  55. 360 FOR N=1 TO 3
  56. 365 V(1,M)=0: V(2,M)=0: V(3,M)=0: V(N,M)=1
  57. 370 GOSUB 650: Q(M,N)=W/E
  58. 375 NEXT N
  59. 380 NEXT M
  60. 385 REM
  61. 390 FOR I=1 TO 3: FOR J=1 TO 3: R(I,J)=0: NEXT J: NEXT I
  62. 395 FOR I=1 TO 3: FOR J=1 TO 3: FOR L=1 TO 3
  63. 400 R(I,J)=R(I,J)+Y(I,L)*Q(L,J)
  64. 405 NEXT L: NEXT J: NEXT I
  65. 410 REM
  66. 415 FOR M=1 TO 3
  67. 420 FOR I=1 TO 3: FOR J=1 TO 3
  68. 425 V(I,J)=R(I,J)
  69. 430 NEXT J: NEXT I
  70. 435 GOSUB 650: E=W
  71. 440 FOR N=1 TO 3
  72. 445 V(1,M)=0: V(2,M)=0: V(3,M)=0: V(N,M)=1
  73. 450 GOSUB 650: Q(M,N)=W/E
  74. 455 NEXT N
  75. 460 NEXT M
  76. 461 REM
  77. 462 REM
  78. 465 REM TRANSFORMATION
  79. 470 PRINT " ------"
  80. 475 INPUT "OPTION 1 OR 2";E
  81. 480 IF E=2 THEN 570
  82. 481 IF E = -999 THEN 9999
  83. 482 IF E<>1 THEN 475
  84. 483 REM
  85. 485 REM CONVERT EQUATORIAL --> TELESCOPE
  86. 490 INPUT " RIGHT ASCENSION (DEG) ";B(0)
  87. 495 INPUT " DECLINATION (DEG) ";D(0)
  88. 500 INPUT " TIME (MIN) ";T
  89. 505 D(0)=D(0)/G: B(0)=(B(0)-K*T*0.25)/G
  90. 510 X(1,1)=COS(D(0))*COS(B(0))
  91. 515 X(2,1)=COS(D(0))*SIN(B(0))
  92. 520 X(3,1)=SIN(D(0))
  93. 525 Y(1,1)=0: Y(2,1)=0: Y(3,1)=0
  94. 530 FOR I=1 TO 3: FOR J=1 TO 3
  95. 535 Y(I,1)=Y(I,1)+R(I,J)*X(J,1)
  96. 540 NEXT J: NEXT I
  97. 545 GOSUB 685: F=F/G: H=H/G: GOSUB 785
  98. 550 GOSUB 685: H=H-Z3
  99. 555 PRINT USING "TELESCOPE DIRECTION (DEG):####.##";F
  100. 560 PRINT USING "TELESCOPE ELEVATION (DEG):####.##";H
  101. 565 GOTO 465
  102. 566 REM
  103. 570 REM CONVERT TELESCOPE --> EQUATORIAL
  104. 575 INPUT " TELESCOPE DIRECTION (DEG) ";F
  105. 580 INPUT " TELESCOPE ELEVATION (DEG) ";H
  106. 585 INPUT " TIME (MIN) ";T
  107. 590 F=F/G: H=(H+Z3)/G: GOSUB 750
  108. 595 X(1,1)=Y(1,0): X(2,1)=Y(2,0): X(3,1)=Y(3,0)
  109. 600 Y(1,1)=0: Y(2,1)=0: Y(3,1)=0
  110. 605 FOR I=1 TO 3: FOR J=1 TO 3
  111. 610 Y(I,1)=Y(I,1)+Q(I,J)*X(J,1)
  112. 615 NEXT J: NEXT I
  113. 620 GOSUB 685: F=F+K*T*0.25: F=F-INT(F/360)*360
  114. 625 PRINT USING "RIGHT ASCENSION (DEG):####.##";F
  115. 630 PRINT USING "DECLINATION (DEG): ####.##";H
  116. 635 GOTO 465
  117. 640 END
  118. 645 REM
  119. 650 REM DETERMINANT SUBROUTINE
  120. 655 W=V(1,1)*V(2,2)*V(3,3)+V(1,2)*V(2,3)*V(3,1)
  121. 660 W=W+V(1,3)*V(3,2)*V(2,1)
  122. 665 W=W-V(1,3)*V(2,2)*V(3,1)-V(1,1)*V(3,2)*V(2,3)
  123. 670 W=W-V(1,2)*V(2,1)*V(3,3)
  124. 675 RETURN
  125. 680 REM
  126. 685 REM ANGLE SUBROUTINE
  127. 690 C=SQR(Y(1,1)*Y(1,1)+Y(2,1)*Y(2,1))
  128. 695 IF C=0 AND Y(3,1)>0 THEN H=90
  129. 700 IF C=0 AND Y(3,1)<0 THEN H=-90
  130. 705 IF C<>0 THEN H=ATN(Y(3,1)/C)*G
  131. 710 REM
  132. 715 IF C=0 THEN F=1000
  133. 720 IF C<>0 AND Y(1,1)=0 AND Y(2,1)>0 THEN F=90
  134. 725 IF C<>0 AND Y(1,1)=0 AND Y(2,1)<0 THEN F=270
  135. 730 IF Y(1,1)>0 THEN F=ATN(Y(2,1)/Y(1,1))*G
  136. 735 IF Y(1,1)<0 THEN F=ATN(Y(2,1)/Y(1,1))*G+180
  137. 740 F=F-INT(F/360)*360
  138. 745 RETURN
  139. 746 REM
  140. 750 REM SUBROUTINE
  141. 755 Y(1,0)=COS(F)*COS(H)-SIN(F)*(Z2/G)
  142. 760 Y(1,0)=Y(1,0)+SIN(F)*SIN(H)*(Z1/G)
  143. 765 Y(2,0)=SIN(F)*COS(H)+COS(F)*(Z2/G)
  144. 770 Y(2,0)=Y(2,0)-COS(F)*SIN(H)*(Z1/G)
  145. 775 Y(3,0)=SIN(H)
  146. 780 RETURN
  147. 781 REM
  148. 785 REM SUBROUTINE
  149. 790 Y(1,1)=COS(F)*COS(H)+SIN(F)*(Z2/G)
  150. 795 Y(1,1)=Y(1,1)-SIN(F)*SIN(H)*(Z1/G)
  151. 800 Y(2,1)=SIN(F)*COS(H)-COS(F)*(Z2/G)
  152. 805 Y(2,1)=Y(2,1)+COS(F)*SIN(H)*(Z1/G)
  153. 810 Y(3,1)=SIN(H)
  154. 815 RETURN
  155. 816 REM
  156. 817 REM STAR LIST
  157. 820 DATA "A UMI", 37.960, 89.264
  158. 825 DATA "A TAU", 68.980, 16.509
  159. 830 DATA "B ORI", 78.634, -8.202
  160. 835 DATA "A AUR", 79.172, 45.998
  161. 840 DATA "A ORI", 88.793, 7.407
  162. 845 DATA "A CMA", 101.287, -16.716
  163. 850 DATA "A GEM", 113.650, 31.888
  164. 855 DATA "A CMI", 114.825, 5.225
  165. 860 DATA "B GEM", 116.329, 28.026
  166. 865 DATA "A LEO", 152.093, 11.967
  167. 870 DATA "A VIR", 201.298, -11.161
  168. 875 DATA "A BOO", 213.915, 19.183
  169. 880 DATA "A SCO", 247.352, -26.432
  170. 885 DATA "A LYR", 279.234, 38.784
  171. 890 DATA "A AQL", 297.695, 8.868
  172. 895 DATA "A CYG", 310.358, 45.280
  173. 900 DATA "A PSA", 344.413, -29.622
  174. 1000 REM *****************************************
  175. 1010 REM FROM SKY & TELESCOPE, FEBRUARY, 1989,
  176. 1020 REM PAGES 194-196. LINES 760 AND 795
  177. 1030 REM CONTAINED ERRORS AS PRINTED IN THE
  178. 1040 REM MAGAZINE; THEY ARE CORRECTED HERE.
  179. 1050 REM *****************************************
  180. 9999 END