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.
 
 
 
 
 
 

47 lines
1.2 KiB

  1. 10 REM Solar Surface Oscillations
  2. 20 REM SOLAROSC.BAS by John Kennewell
  3. 30 DIM P(200)
  4. 40 SCREEN 12: PH=1.570795: MX=0
  5. 50 RD=1: GN=256: BL=65536!
  6. 60 PRINT "Solar Oscillation Modes"
  7. 70 INPUT "Degree L [0 to 28]";L
  8. 80 INPUT "Order M [0 to L ]";M
  9. 90 REM Generate Legendre function
  10. 100 FOR XI=0 TO 200
  11. 110 X=(XI-100)/100: D=SQR(1-X*X)
  12. 120 P1=D^L: P2=0
  13. 130 FOR LI=1 TO (2*L-1) STEP 2
  14. 140 P1=P1*LI: NEXT LI
  15. 150 IF M>=L OR P1=0 THEN 200
  16. 160 FOR MI=L-1 TO M STEP -1
  17. 170 PM=2*(MI+1)*X*P1/D-P2
  18. 180 PM=PM/(L-MI)/(L+MI+1)
  19. 190 P2=P1: P1=PM: NEXT MI
  20. 200 P(XI)=P1: MT=ABS(P1)
  21. 210 IF MT>MX THEN MX=MT
  22. 220 NEXT XI
  23. 230 CLS : COLOR 1: LOCATE 2,3
  24. 240 PRINT "Solar Global Oscillations"
  25. 250 LOCATE 28,3
  26. 260 PRINT "MODE : L ="; L;" M =";M
  27. 270 REM Show color palette
  28. 280 FOR I=1 TO 15
  29. 290 LINE (600,-15+30*I)-(620,15+30*I),I,BF
  30. 300 RC=RD*INT((15-I)*4.5)
  31. 310 BC=BL*INT((I-1)*4.5)
  32. 320 GC=GN*INT((7-ABS(8-I))*4.5)
  33. 330 PALETTE I,RC+BC+GC: NEXT I
  34. 340 REM Plotting
  35. 350 FOR CT=-1 TO 1 STEP .005
  36. 360 ST=SQR(1-CT*CT)
  37. 370 PM=P(CT*100+100)/MX
  38. 380 FOR SF=-1 TO 1 STEP .005
  39. 390 CF=SQR(1-SF*SF)
  40. 400 FI=PH*SGN(SF)
  41. 410 IF CF<>0 THEN FI=ATN(SF/CF)
  42. 420 S=PM*COS(M*FI)*ST*CF
  43. 430 X%=300+200*SF*ST
  44. 440 Y%=240-200*CT
  45. 450 PSET (X%,Y%),8-7*S
  46. 460 NEXT SF: NEXT CT: END