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.
 
 
 
 
 
 

94 lines
2.3 KiB

  1. 10 REM GLOBE-DRAWING PROGRAM
  2. 15 REM
  3. 20 FF=1: REM FLATTENING FACTOR
  4. 40 RM=80: REM RADIUS OF GLOBE
  5. 50 INPUT "TILT ANGLE ";T
  6. 60 DR=3.14159/180: TI=T*DR
  7. 80 XC=250: YC=150: REM SCR CENTER
  8. 90 CT=COS(TI): ST=SIN(TI)
  9. 95 REM
  10. 100 REM DRAW LATITUDE LINES
  11. 110 FOR LA=-75 TO 75 STEP 15
  12. 120 IF T>0 THEN 150
  13. 130 IF 90+T<LA THEN 270
  14. 140 GOTO 160
  15. 150 IF T-90>LA THEN 270
  16. 160 L=LA*DR:SL=SIN(L):R=RM*COS(L)
  17. 170 GOSUB 570
  18. 190 FOR P1=PS+5 TO -PS STEP 5
  19. 200 P=P1*DR: X=R*SIN(P)+XC
  20. 210 Y1=RM*SL: Z1=R*COS(P)
  21. 220 Z=Z1*CT+Y1*ST
  22. 225 Y=-Z1*ST+Y1*CT+YC
  23. 230 IF Z<0 THEN 250
  24. 240 LINE (XS,YS*FF)-(X,Y*FF)
  25. 250 XS=X: YS=Y
  26. 260 NEXT P1
  27. 270 NEXT LA
  28. 280 REM DRAW LONGITUDE LINES
  29. 290 FOR L=-180 TO 165 STEP 15
  30. 300 LO=L*DR
  31. 310 IF TI<0 THEN 340
  32. 320 TH=90*DR: DT=-5*DR: GOTO 350
  33. 340 TH=-90*DR: DT=5*DR
  34. 350 GOSUB 750
  35. 360 Z=1: TH=TH+DT
  36. 380 CH=COS(TH): X=RM*SIN(LO)*CH+XC
  37. 390 Y1=RM*SIN(TH):Z1=RM*COS(LO)*CH
  38. 400 Z=Y1*ST+Z1*CT:Y=Y1*CT-Z1*ST+YC
  39. 410 IF Z<0 THEN 430
  40. 420 LINE (XS,YS*FF)-(X,Y*FF)
  41. 430 XS=X: YS=Y: TH=TH+DT
  42. 440 IF Z>=0 THEN 380
  43. 450 NEXT L
  44. 460 REM DRAW LIMB OF GLOBE
  45. 470 XS=RM+XC: YS=YC
  46. 480 FOR I=0 TO 360 STEP 10
  47. 490 IA=I*DR: X=RM*COS(IA)+XC
  48. 500 Y=RM*SIN(IA)+YC
  49. 510 LINE (XS,YS*FF)-(X,Y*FF)
  50. 520 XS=X: YS=Y
  51. 530 NEXT I
  52. 540 INPUT A$
  53. 550 END
  54. 560 REM STARTING LATITUDE LINE
  55. 570 CP=-ST*SIN(L)/(CT*COS(L))
  56. 580 IF CP>=1 OR CP<=-1 THEN 640
  57. 590 IF CP*CP>.001 THEN 620
  58. 600 P=-90*DR: GOTO 650
  59. 620 TP=SQR(1-CP*CP)/CP: P=ATN(TP)
  60. 630 GOTO 650
  61. 640 P=0
  62. 650 IF P<=0 THEN 680
  63. 660 P=-P: GOTO 690
  64. 680 P=-180*DR-P
  65. 690 X=R*SIN(P)+XC
  66. 700 Y1=RM*SIN(L): Z1=R*COS(P)
  67. 710 Y=-Z1*SIN(TI)+Y1*COS(TI)+YC
  68. 720 XS=X: YS=Y: PS=P/DR
  69. 730 RETURN
  70. 740 REM STARTING LONGITUDE LINE
  71. 750 X=RM*SIN(LO)*COS(TH)+XC
  72. 760 Y1=RM*SIN(TH)
  73. 770 Z1=RM*COS(LO)*COS(TH)
  74. 780 Y=-Z1*ST+Y1*CT+YC: XS=X: YS=Y
  75. 790 RETURN
  76. 800 REM This program is used
  77. 810 REM to draw an outline of a
  78. 811 REM planet's disk with latitude
  79. 812 REM and longitude lines as an
  80. 813 REM aid to sketching in features
  81. 814 REM at the telescope and identi-
  82. 815 REM fying them on a published map.
  83. 816 REM How it works is discussed by
  84. 817 REM Charles Hartley in the Jan-
  85. 818 REM uary, 1990, issue of Sky &
  86. 819 REM Telescope magazine. Intended
  87. 820 REM for Macintosh, but works on
  88. 821 REM IBM PC's with very little
  89. 822 REM modification. For example,
  90. 823 REM add line 95 SCREEN 9 if you
  91. 824 REM have VGA graphics, and try
  92. 825 REM setting FF=0.7 in line 20 to
  93. 826 REM get a disk that looks right.