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.
 
 
 
 
 
 

57 lines
1.5 KiB

  1. 10 REM RAINBOW SIMULATION
  2. 20 REM
  3. 25 R0=180/3.14159
  4. 30 REM RANDOM IMPACT PARAMETER
  5. 35 X=-1+2*RND(1)
  6. 40 Y=-1+2*RND(1)
  7. 45 B=SQR(X*X+Y*Y)
  8. 50 IF B>=1 THEN 30
  9. 55 REM COLOR & INDEX OF REFR.
  10. 60 C=1+INT(3*RND(1))
  11. 65 N=1.33+.01*(C-1)
  12. 70 REM COMPUTE ANGLES
  13. 75 I=ATN(B/SQR(1-B*B))
  14. 80 R=ATN(B/SQR(N*N-B*B))
  15. 85 T1=(4*R-2*I)*R0
  16. 90 T2=(6*R-2*I)*R0-180
  17. 95 REM INTENSITY FACTORS
  18. 100 RS=(SIN(I-R)/SIN(I+R))^2
  19. 105 RP=(TAN(I-R)/TAN(I+R))^2
  20. 110 RB=(1-RP)*(1-RP)
  21. 115 RC=(1-RS)*(1-RS)
  22. 120 I1=(RS*RC+RP*RB)/2
  23. 125 I2=(RS*RS*RC+RP*RP*RB)/2
  24. 130 IF I1<.04*RND(1) THEN 140
  25. 135 TH=T1: GOSUB 180
  26. 140 IF I2<.02*RND(1) THEN 150
  27. 145 TH=T2: GOSUB 180
  28. 150 GOTO 30
  29. 155 REM COLORS & SCREEN
  30. 160 SCREEN 9: CLS: KEY OFF: NP=0
  31. 165 PALETTE 1,4: PALETTE 2,2
  32. 170 PALETTE 3,9
  33. 175 RETURN
  34. 180 REM PLOT ON SCREEN
  35. 185 TH=ABS(TH)
  36. 190 IF TH>60 THEN RETURN
  37. 195 XP=320+320*(TH/60)*(X/B)
  38. 200 YP=325-300*(TH/60)*ABS(Y/B)
  39. 205 PSET(XP,YP),C: NP=NP+1
  40. 210 LOCATE 1,1: PRINT NP: RETURN
  41. 215 REM VTAB23: PRINT NP: RETURN
  42. 220 REM FOR APPLE II COMPUTERS
  43. 225 REM COLORS & SCREEN
  44. 230 REM HGR: HOME: NP=0
  45. 235 REM CC(1)=5: CC(2)=1: CC(3)=6
  46. 240 REM RETURN
  47. 245 REM PLOT ON SCREEN
  48. 250 REM TH=ABS(TH)
  49. 255 REM IF TH>60 THEN RETURN
  50. 260 REM XP=139+139*(TH/60)*(X/B)
  51. 265 REM YP=159-159*(TH/60)*ABS(Y/B)
  52. 270 REM HCOLOR=CC(C): NP=NP+1
  53. 275 REM HPLOT XP,YP TO XP+1,YP
  54. 280 REM **************************************
  55. 285 REM APPEARED IN ASTRONOMICAL COMPUTING
  56. 290 REM SKY & TELESCOPE, FEBRUARY 1991 ISSUE
  57. 300 REM **************************************