home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / basic / astrmenu.lbr / WAVEL.BZS / WAVEL.BAS
BASIC Source File  |  1987-04-26  |  1KB  |  37 lines

  1. 1 PRINT "From the June 1985 SKY & TELESCOPE, pp. 545-6."
  2. 2 PRINT
  3. 3 PRINT "This program calcuates, from three lines of known wavelength, the"
  4. 4 PRINT "wavelengths corresponding to any additional features.  The distances"
  5. 5 PRINT "of the lines of known wavelength are measured from some fiducial"
  6. 6 PRINT "point at the red end of the spectrum (so the values increase toward"
  7. 7 PRINT "the blue end) and should be well separated.
  8. 8 PRINT
  9. 9 PRINT "INPUT:  Measured distances (mm) and wavelengths (nm) of three lines"
  10. 10 PRINT "of known wavelength, measured distance (mm) of additional feature."
  11. 11 PRINT
  12. 12 PRINT "OUTPUT:  Calculated wavelength (nm) of additional feature."
  13. 13 PRINT
  14. 100 REM     WAVELENGTHS
  15. 110 REM
  16. 120 INPUT "FIRST KNOWN WAVELENGTH,  DISTANCE";W1,S1
  17. 130 INPUT "SECOND KNOWN WAVELENGTH, DISTANCE";W2,S2
  18. 140 INPUT "THIRD KNOWN WAVELENGTH,  DISTANCE";W3,S3
  19. 180 P=W2-W1: Q=W3-W1: R=S2-S1
  20. 190 S=S3-S1: T=S3-S2
  21. 200 A=R/P: B=S/Q
  22. 210 U=A-B: V=T/U: L=W1-V
  23. 220 D1=A*(W2-L): D2=D1+S1
  24. 230 C=(D1*T)/U
  25. 240 PRINT
  26. 250 INPUT "DISTANCE";D
  27. 260 IF D<0 THEN 310
  28. 270 W=L+(C/(D2-D))
  29. 280 W=INT(W+.5)
  30. 290 PRINT "WAVELENGTH = ";W
  31. 310 RUN "ASTRMENU.BAS"
  32. T "DISTANCE";D
  33. 260 IF D<0 THEN 310
  34. 270 W=L+(C/(D2-D))
  35. 280 W=INT(W+.5)
  36. 290 PRINT "WAVELENGTH = ";W
  37. 310 RU