DECLARE FUNCTION ASIN! (x) DECLARE SUB pager () DIM RS(200), TS(200), RP(200), TP(100), ang(100) 100 PRINT CHR$(12) pi = 3.1415926535# REM GE copeland REM Dept of Physics REM Old Dominion University REM 2/20/2001 PRINT "FRESNEL'S FORMULAS" PRINT PRINT " Let a ray of light be incident from a medium of index n1 onto" PRINT "a plane surface that separates it from a medium of n2. The incident" PRINT "angle be 01, the reflected angle = 01' & the refracted angle is 02" PRINT PRINT " The incident ray may be either s or p polarization, that is," PRINT " s - polarized has the E vector parallel to the surface" PRINT " or" PRINT " p - polarized has the H vector parallel to the surface." PRINT " This program is designed to evaluate the reflection & transmission" PRINT " properties of nonconducting media via an evaluation of the FRESNEL" PRINT " coefficient, r and t. Then the REFLECTANCE and the TRANSMISSION functions" PRINT " are evaluated for many angles and a plotting file is written." PRINT 200 REM REM CALL pager PRINT "Input indicies of refraction n1 and n2? [ n1 < n2 please!]" INPUT n1, n2 211 IF n1 < 0 THEN GOTO 200 215 IF n1 >= 1! AND n2 >= 1! AND n2 > n1 THEN GOTO 300 220 PRINT "n1 and n2 must both be > 1." 230 GOTO 200 300 REM PRINT " R= r**2 = the REFLECTANCE." PRINT " The TRANSMITANCE is NOT t**2!!! But is 1-R for nonconducting media." PRINT " For p polarization, T (p) is given by" PRINT " n2 cos(02) 2" PRINT " T (p) = --------------- t12p" PRINT " n1 cos(01)" PRINT " The TRANSMITANCE is NOT t**2!!! But is 1-R for nonconducting media." PRINT " For s polarization, T (s) is given by" PRINT " n2 cos(02) 2" PRINT " T (s) = --------------- t12s" PRINT " n1 cos(01)" REM s polarization th1 = 1 * pi / 180! th2 = 89 * pi / 180 thinc = pi / 180 j = 0 FOR ang1 = th1 TO th2 STEP thinc j = j + 1 theta1 = ang1 theta2 = ASIN((n1 / n2) * SIN(theta1)) ang2 = theta2 r12s = SIN(theta2 - theta1) / SIN(theta2 + theta1) R = r12s ^ 2 RS(j) = R t12s = 2! * COS(theta1) * SIN(theta2) / SIN(theta2 + theta1) T = ((n2 * COS(theta2)) / (n1 * COS(theta1))) * t12s ^ 2 TS(j) = T NEXT ang1 REM p polarization j = 0 FOR ang1 = th1 TO th2 STEP thinc j = j + 1 theta1 = ang1 theta2 = ASIN((n1 / n2) * SIN(theta1)) ang2 = theta2 r12p = TAN(theta1 - theta2) / TAN(theta2 + theta1) R = r12p ^ 2 RP(j) = R t12p = COS(theta1) * SIN(theta2) / (SIN(theta2 + theta1) * COS(theta1 - theta2)) t12p = 2! * t12p T = ((n2 * COS(theta2)) / (n1 * COS(theta1))) * t12p ^ 2 TP(j) = T ang(j) = ang1 * 180 / pi NEXT ang1 PRINT "writing the plotting file plttek.dat" OPEN "plttek.dat" FOR OUTPUT AS #2 PRINT #2, 1 PRINT #2, 4 PRINT #2, j PRINT #2, " Transmittance / Reflectance" PRINT #2, "Incidence angle" PRINT #2, "Fresnel formulae - s & p" PRINT #2, "N1= "; n1; " n2 = "; n2 FOR i = 1 TO j PRINT #2, ang(i), RS(i) NEXT i FOR i = 1 TO j PRINT #2, ang(i), TS(i) NEXT i FOR i = 1 TO j PRINT #2, ang(i), RP(i) NEXT i FOR i = 1 TO j PRINT #2, ang(i), TP(i) NEXT i CLOSE #2 CHAIN "Tek2wplt.bas" END FUNCTION ASIN (x) ASIN = ATN(x / SQR(1 - x ^ 2)) END FUNCTION 600 SUB pager 602 PRINT , "Push RETURN to continue." 604 INPUT dum$ 606 PRINT CHR$(12) END SUB