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.
 
 
 
 
 
 

51 lines
1.3 KiB

  1. 10 REM RONCHI.BAS
  2. 20 REM
  3. 30 INPUT "Mirror diameter ";D
  4. 40 INPUT "Radius of curvature";R
  5. 50 INPUT "Grating frequency ";F
  6. 60 PRINT "Grating distance Delta"
  7. 70 PRINT " from the mirror's
  8. 80 PRINT " center of curvature"
  9. 90 INPUT " (+ is outside) ";DL
  10. 100 W=1/(2*F): REM Line width
  11. 120 CLS
  12. 130 SCREEN 2
  13. 140 X0=300: Y0=100: C=300
  14. 150 K=.42
  15. 160 CIRCLE (X0,Y0),C/2
  16. 170 FOR I=1 TO 10000
  17. 180 X=D*(RND(1)-.5)
  18. 190 Y=D*(RND(1)-.5)
  19. 200 REM X and Y are the ray's
  20. 210 REM coordinates on the face
  21. 220 REM of the mirror
  22. 230 S2=X*X+Y*Y
  23. 240 IF SQR(S2)>D/2 THEN 390
  24. 250 Z=R+S2/R
  25. 260 L=R+DL-Z
  26. 270 U=L*X/Z
  27. 280 REM Now, test to see if the
  28. 290 REM ray is blocked (FL=0)
  29. 300 REM or transmitted (FL=1)
  30. 310 REM by the grating
  31. 320 FL=0: REM Reset flag
  32. 330 T=INT(ABS(U/W)+.5)
  33. 340 IF T/2=INT(T/2) THEN FL=1
  34. 350 IF FL=0 THEN 390
  35. 360 XP=X0+X*C/D
  36. 370 YP=Y0+Y*K*C/D
  37. 380 PSET(XP,YP): REM Plot point
  38. 390 NEXT I
  39. 400 LOCATE 1,1
  40. 410 PRINT "Diameter = ";D
  41. 420 LOCATE 2,1
  42. 430 PRINT "R of C = ";R
  43. 440 LOCATE 3,1
  44. 450 PRINT "Ronchi freq =";F
  45. 460 LOCATE 4,1
  46. 470 PRINT "Delta = ";DL
  47. 480 END
  48. 490 REM ************************************
  49. 500 REM APPEARED IN ASTRONOMICAL COMPUTING
  50. 510 REM SKY & TELESCOPE - APRIL 1991 ISSUE
  51. 520 REM ************************************