ay = 170: fg = 75

CLS

SCREEN 12

LOCATE 10, 1

PRINT "                              PROGRAMA 'ELIPOLA'"

PRINT

PRINT

PRINT "     Grafica la elipse de polarizacion y el sentido de giro tomando como datos"

PRINT "las amplitudes en dos ejes ortogonales y la diferencia de fase entre ellas"

PRINT "     Formulas tomadas de Born-Wolf,'Principles of Optics', Pergamon 1959,"

PRINT "pag 27, formulas 30 a 32."

PRINT "     Verificada coincidencia con Rey Pastor-Santalo-Balanzat,"

PRINT "'Geometria Analitica', Kapelusz 1955, pag 143, formula 1 y pag 156, formula 26"

PRINT "     Los valores predeterminados corresponden al ejemplo de Fig. 1.2"

PRINT "     Para terminar introducir Ay = 0"

DO: LOOP WHILE INKEY$ = ""

pi = 4 * ATN(1)

ax = 200

dt = .01

verde = 10

rojo = 4

DO

CLS

PRINT "Amplitud en y (0<Ay<200)": PRINT

PRINT "Ay ="; ay; : INPUT a$: IF a$ <> "" THEN ay = VAL(a$)

IF ay = 0 THEN END

PRINT : PRINT : PRINT

PRINT "Fase en grados, fg": PRINT

PRINT "fg ="; fg; : INPUT a$: IF a$ <> "" THEN fg = VAL(a$)

f = fg * pi / 180

alfa = ATN(ay / ax)

psi = .5 * ATN(TAN(2 * alfa) * COS(f))

psig = (180 / pi) * psi

u = SIN(2 * alfa) * SIN(f)

IF u = 1 THEN u = .99999

ji = .5 * ATN(u / SQR(1 - u ^ 2))

ea = SQR((ax ^ 2 + ay ^ 2) / (1 + TAN(ji) ^ 2))

eb = ea * TAN(ji)

cp = COS(psi)

sp = SIN(psi)

CLS

PRINT "Amplitud Ax ="; ax, "Amplitud Ay ="; ay, "Fase en grados ="; fg

LOCATE 30, 1

PRINT "Eje a ="; ea, "Eje b ="; eb, "Angulo (a,x) ="; INT(psig * 1000) / 1000;

LINE (319 - ax, 239 - ay)-(320 + ax, 239 + ay), 15, B

LINE (319 - ea * cp, 239 + ea * sp)-(319 + ea * cp, 239 - ea * sp)

LINE (319 - eb * sp, 239 - eb * cp)-(319 + eb * sp, 239 + eb * cp)

LINE (319 - ax, 239)-(319 + ax, 239), 8

LINE (319, 239 - ay)-(319, 239 + ay), 8

DO WHILE INKEY$ = ""

FOR t = 0 TO 360 STEP dt

ex = ax * COS(pi * t / 180)

ey = ay * COS((pi / 180) * (t + fg))

PSET (320 + ex, 239 - ey), verde

NEXT t

SWAP verde, rojo

LOOP

LOOP