DEFDBL A-Z

CLS

COLOR 15

LOCATE 6, 1

PRINT "                              PROGRAM 'CAUSTIC'"

PRINT

PRINT

PRINT "The caustic originates in spherical aberration. In the third order"

PRINT "approximation the height of intersection of a ray in the paraxial"

PRINT "plane is proportional to the cube of the height in the pupil."

PRINT "In the graph the pupil is to the left at a large distance X0"

PRINT "and has a large radius RP in arbitrary units."

PRINT "The graph begins at x pixels (0<x<640) to the left of the paraxial plane"

PRINT "It is drawn the paraxial plane and an even number N of rays."

PRINT "The default values are those of Fig.4.18. "

PRINT "To finish put N = 0"

DO: LOOP WHILE INKEY$ = ""

bv = .25

x0 = -8000

rp = 8000

x = 147

n = 10

SCREEN 12

CLS

DO

PRINT "B1 coefficient ="; bv;

INPUT a$: IF a$ <> "" THEN bv = VAL(a$)

PRINT "Distance to the pupil X0 ="; x0;

INPUT a$: IF a$ <> "" THEN x0 = VAL(a$)

PRINT "Radius of the pupil RP ="; rp;

INPUT a$: IF a$ <> "" THEN rp = VAL(a$)

PRINT "Distance from paraxial plane to the left border x ="; x;

INPUT a$: IF a$ <> "" THEN x = VAL(a$)

PRINT "Half number of rays N/2 ="; n;

INPUT a$: IF a$ <> "" THEN n = VAL(a$)

IF n = 0 THEN END

CLS

FOR y0 = -rp TO rp STEP rp / n

b = bv / 1000000000

y = b * y0 ^ 3

y1 = (y - y0) * (640 - x) / (x - x0) + y

yc0 = -y0 + 240

yc1 = -y1 + 240

LINE (x0, yc0)-(640, yc1)

NEXT y0

LINE (x, 0)-(x, 480)'

DO: LOOP WHILE INKEY$ = ""

LOOP