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.

shadow.bas 1.7 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. 10 REM MOUNTAIN SHADOWS
  2. 11 REM
  3. 12 DIM M(70): C=-0.4
  4. 13 DR=2*3.14159265/360: FM=1/5280
  5. 14 INPUT "MOUNTAIN HEIGHT (FT)";H1
  6. 15 INPUT "OBSERVER HEIGHT (FT)";H0
  7. 16 INPUT "HORIZON HEIGHT (FT) ";H
  8. 17 H1=H1*FM: H0=H0*FM: H=H*FM
  9. 18 INPUT "SLOPE ";S: S=S*DR
  10. 19 INPUT "SUN ALT";A: A=A*DR
  11. 20 INPUT "OBS'R AZ";Z: Z=Z*DR
  12. 21 E=0.30: B=0.005: B9=0.9+B
  13. 22 H9=60: V9=30: W=1*DR
  14. 23 S9=2.5*LOG(B9)/LOG(10)
  15. 24 S0=2.5*LOG(B)/LOG(10)
  16. 25 REM OBSERVER'S LOCATION
  17. 26 X0=COS(Z)*(H1-H0)/TAN(S)
  18. 27 Y0=SIN(Z)*(H0-H1)/TAN(S)
  19. 28 Z0=H0-H1
  20. 29 REM SET UP GRID OF DIRECTIONS
  21. 30 FOR J=1 TO V9
  22. 31 AL=W*(V9/2-J)
  23. 32 FOR I=1 TO H9
  24. 33 AZ=W*(I-H9/2)
  25. 34 REM DISTANCE TO 'NORTH' SLOPE
  26. 35 REM SHADOW PLANE
  27. 36 A0=SQR(TAN(S)^2-TAN(A)^2)
  28. 37 A1=-1*TAN(AL)/COS(AZ)-TAN(A)
  29. 38 A2=A0*TAN(AZ)
  30. 39 A3=-X0*TAN(AL)/COS(AZ)-Z0
  31. 40 A4=A0*(Y0+X0*TAN(AZ))
  32. 41 XI=(A3+A4)/(A1+A2)
  33. 42 F1=0: D=TAN(AZ)
  34. 43 IF XI>=X0 THEN F1=1
  35. 44 A5=1+D^2+(TAN(AL)/COS(AZ))^2
  36. 45 D1=ABS(XI-X0)*SQR(A5)
  37. 46 REM DIST TO 'SOUTH' SLOPE
  38. 47 REM SHADOW PLANE
  39. 48 XI=(A3-A4)/(A1-A2)
  40. 49 F2=0
  41. 50 IF XI>=X0 THEN F2=1
  42. 51 D2=ABS(XI-X0)*SQR(A5)
  43. 52 REM DISTANCE TO HORIZON PLANE
  44. 53 F3=0: IF AL>=0 THEN F3=1
  45. 54 D3=(H0-H)/SIN(ABS(AL)+0.001)
  46. 55 REM INTEGRATE ALONG ILLUMINATED
  47. 56 REM PORTION OF LINE OF SIGHT
  48. 57 D0=100*E
  49. 58 IF D1<D0 AND F1=0 THEN D0=D1
  50. 59 IF D2<D0 AND F2=0 THEN D0=D2
  51. 60 IF D3<D0 AND F3=0 THEN D0=D3
  52. 61 IF F1+F2+F3=3 THEN D0=0
  53. 62 B0=10^(C*E*D0)
  54. 63 IF F3=0 THEN B0=B0-10^(C*E*D3)
  55. 64 IF B0>B9-B THEN B0=B9-B
  56. 65 G=S9-S0
  57. 66 SK=2.5*LOG(B0+B)/LOG(10)
  58. 67 M(I)=INT(0.05+9.9*(SK-S0)/G)
  59. 68 NEXT I
  60. 69 FOR I9=1 TO H9
  61. 70 PRINT RIGHT$(STR$(M(I9)),1);
  62. 71 NEXT I9: PRINT
  63. 72 NEXT J
  64. 73 END
  65. 74 REM **************************
  66. 75 REM ASTRONOMICAL COMPUTING
  67. 76 REM SKY & TELESCOPE, APRIL 88
  68. 77 REM **************************