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.

blkhole3.bas 758 B

123456789101112131415161718192021222324252627
  1. 10 REM Compute Black-Hole Accelergram
  2. 20 P = 3.14159
  3. 30 A$="##.### ##.### ##.### ##.###"
  4. 40 OPEN "OUTPUT.TXT" FOR OUTPUT AS #1
  5. 50 FOR I=0 TO 1000
  6. 60 REM Generate random circumference
  7. 70 C=2!*P*RND
  8. 80 REM Generate random angle
  9. 90 T=2!*P*RND: R=C/(2!*P)
  10. 100 X1=R*COS(T): Y1=R*SIN(T)
  11. 110 REM Determine vector length
  12. 120 R=R-.001/(C*C*C)
  13. 130 IF R<0 THEN R=0
  14. 140 X2=R*COS(T): Y2=R*SIN(T)
  15. 150 D=SQR((X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1))
  16. 160 REM Don't plot vectors too small to see
  17. 170 REM Print end-points for plot package
  18. 180 IF D<.001 THEN GOTO 200
  19. 190 PRINT#1, USING A$;X1;Y1;X2;Y2
  20. 200 NEXT I
  21. 210 CLOSE#1
  22. 220 REM ========================
  23. 230 REM FROM "ASTRONOMICAL
  24. 240 REM COMPUTING," SKY & TELE-
  25. 250 REM SCOPE, MAY 1996
  26. 260 REM ========================
  27. 270 END