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.

supernum.bas 1.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. 10 REM SUPERNUM.BAS
  2. 20 REM by Rodney Kubesh
  3. 30 OPEN "BOW.DAT" FOR OUTPUT AS #1
  4. 40 CLS
  5. 50 ' PI=3.14159
  6. 60 A0=1.5707288# : A1=-.2121144
  7. 70 A2=.074261 : A3=-.0187293
  8. 80 N=1.3318 : REM Refractive index
  9. 90 RA=250 : REM Drop radius in microns
  10. 100 L=.6563 : REM Wavelength in microns
  11. 110 FOR J=450 TO 550
  12. 120 REM Choose angle of incidence for ray A
  13. 130 I=J*.1*PI/180
  14. 140 AN=SIN(I)/N
  15. 150 REM Snell's Law gives angle of refraction
  16. 160 R=PI/2-(1-AN)^.5*(A0+A1*AN+A2*AN^2+A3*AN^3)
  17. 170 TH=4*R-2*I
  18. 180 LOCATE 12,15
  19. 190 PRINT "Computing intensity for emergence angle = ";
  20. 200 PRINT USING "###.##"; TH*180/PI
  21. 210 REM D and S are path lengths outside the drop for ray A
  22. 220 D=1-COS(I)
  23. 230 X0=-COS(4*R-I) : Y0=-SIN(4*R-I)
  24. 240 X1=X0 : X2=X0-1 : X3=X0-2
  25. 250 Y1=Y0-1/TAN(TH)
  26. 260 Y2=Y0
  27. 270 Y3=Y0-2*TAN(TH)
  28. 280 S1=(Y2-Y1)/(X2-X1)
  29. 290 S2=(Y3-Y0)/(X3-X0)
  30. 300 I2=I
  31. 310 X=(Y0-Y1+S1*X1-S2*X0)/(S1-S2)
  32. 320 Y=(X-X1)*S1+Y1
  33. 330 S=((Y-Y0)^2+(X-X0)^2)^.5
  34. 340 REM Find total path length
  35. 350 P1=RA*(D+S+4*N*COS(R))
  36. 360 IN=59.5
  37. 370 REM Choose possible angles of incidence for ray B
  38. 380 IN=IN+.05
  39. 390 I=IN*PI/180
  40. 400 AN=SIN(I)/N
  41. 410 R=PI/2-(1-AN)^.5*(A0+A1*AN+A2*AN^2+A3*AN^3)
  42. 420 REM Find companion rays emerging in same direction
  43. 430 TL=ABS(TH-4*R+2*I)
  44. 440 IF TL>.001 GOTO 380
  45. 450 TH=4*R-2*I
  46. 460 REM Path lengths D and S for ray B
  47. 470 D=1-COS(I)
  48. 480 X0=-COS(4*R-I) : Y0=-SIN(4*R-I)
  49. 490 X3=X0-2
  50. 500 Y3=Y0-2*TAN(TH)
  51. 510 S1=(Y2-Y1)/(X2-X1)
  52. 520 S2=(Y3-Y0)/(X3-X0)
  53. 530 X=(Y0-Y1+S1*X1-S2*X0)/(S1-S2)
  54. 540 Y=(X-X1)*S1+Y1
  55. 550 S=((Y-Y0)^2+(X-X0)^2)^.5
  56. 560 REM Total path length for ray B
  57. 570 P2=RA*(D+S+4*N*COS(R))
  58. 580 REM Find difference in path length
  59. 590 PD=P1-P2
  60. 600 PH=2*PI*PD/L-PI/2
  61. 610 REM Find amplitude
  62. 620 AM=COS(PH/2)
  63. 630 REM Print emergence angle and intensity
  64. 640 PRINT#1, USING "###.###"; TH*180/PI; AM^2
  65. 650 NEXT J
  66. 660 CLOSE#1
  67. 670 END
  68. 900 REM ---------------------------
  69. 910 REM APPEARED IN ASTRONOMICAL
  70. 920 REM COMPUTING, SKY & TELESCOPE,
  71. 930 REM SEPTEMBER 1998, PAGE 70
  72. 940 REM ---------------------------