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.

sunshine.bas 907 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 10 REM SUNSHINE
  2. 12 REM
  3. 14 P=3.14159265: R=P/180
  4. 16 INPUT "LATITUDE (DEGREES)";F
  5. 18 F=F*R
  6. 20 S=SIN(F): C=COS(F)
  7. 22 INPUT "START DAY IN 1986 ";J1
  8. 24 INPUT "END DAY IN 1986 ";J2
  9. 26 IF J2<J1 THEN 24
  10. 28 Z=0
  11. 30 FOR D=J1 TO J2
  12. 32 M=357.1663+0.9856*D
  13. 34 M=M*R
  14. 36 L=279.8603+0.985647*D
  15. 38 L=L+1.91533*SIN(M)
  16. 40 L=L+0.02001*SIN(2*M)
  17. 42 L=L+0.00029*SIN(3*M)
  18. 44 L=L*R
  19. 46 G=0.3978062*SIN(L)
  20. 48 K=SQR(1-G*G)
  21. 50 U=(-0.01454-S*G)/(K*C)
  22. 52 IF ABS(U)<1 THEN 58
  23. 54 IF U>1 THEN 70
  24. 56 Z=Z+1440: GOTO 70
  25. 58 F=0.9043+0.03023*COS(M)
  26. 60 F=F/(1-0.15825*SIN(L)*SIN(L))
  27. 62 A=ATN(SQR(1-U*U)/U)
  28. 64 A=A/R
  29. 66 IF U<0 THEN A=A+180
  30. 68 Z=Z+2880*A/(360.985647-F)
  31. 70 NEXT D
  32. 72 PRINT
  33. 74 PRINT "SUNSHINE = "
  34. 76 PRINT INT(Z+0.5);" MINUTES"
  35. 78 PRINT INT((Z+30)/60);" HOURS"
  36. 80 END
  37. 85 REM ------------------------
  38. 88 REM APPEARED IN ASTRONOMICAL
  39. 89 REM COMPUTING, SKY & TELE-
  40. 90 REM SCOPE, SEPTERMBER, 1984
  41. 92 REM ------------------------