SCREEN 12

LOCATE 6, 1

PRINT "                           PROGRAM 'ABACART'"

PRINT "Aberrations 'a la carte'."

PRINT "Constructs a ficticious spot diagram starting from third order"

PRINT "aberration coefficients arbitrarily supplied."

PRINT "To homologate them, a value of 100 is taken so as if present alone"

PRINT "fills the square frame."

PRINT "Distortion and field curvature are not considered because they"

PRINT "do not influence the image, within this context."

PRINT "It is introduced the first order aberration 'defocus' to examine the"

PRINT "image along the axis."

PRINT "The composition of aberrations modify the dimensions of the resulting figure"

PRINT "and coma introduces an asymmetry. It is necessary to manually compensate"

PRINT "for both things varying the scale and horizontal shift until the image"

PRINT "is squared. "

PRINT "It is useful to compare with ray tracing."

PRINT "The default values corresponds to the first frame of Fig.4.23"

PRINT "To finish put scale = 0."

DO: LOOP WHILE INKEY$ = ""

CLS

eesf = 0

ccma = 100

aast = 100

ddfc = 0

ddhz = -.91

esc = .63

DO

LOCATE 1, 1

PRINT "spherical aberration ="; eesf; : INPUT a$

IF a$ <> "" THEN eesf = VAL(a$)

esf = eesf * .6

PRINT "coma ="; ccma; : INPUT a$

IF a$ <> "" THEN ccma = VAL(a$)

cma = ccma * 1.6

PRINT "astigmatism ="; aast; : INPUT a$

IF a$ <> "" THEN aast = VAL(a$)

ast = aast * 1.2

PRINT "defocus ="; ddfc; : INPUT a$

IF a$ <> "" THEN ddfc = VAL(a$)

dfc = ddfc * 2.4

PRINT "horizontal shift ="; ddhz; : INPUT a$

IF a$ <> "" THEN ddhz = VAL(a$)

dhz = ddhz * 240

PRINT "scale ="; esc; : INPUT a$

IF a$ <> "" THEN esc = VAL(a$)

IF esc = 0 THEN END

CLS

20 FOR i = 1 TO 5000

3 y = 2 * RND - 1

z = 2 * RND - 1

IF y ^ 2 + z ^ 2 > 1 THEN 3

yesf = 4 * esf * y * (y ^ 2 + z ^ 2)

zesf = 4 * esf * z * (y ^ 2 + z ^ 2)

ycma = cma * (3 * y ^ 2 + z ^ 2)

zcma = 2 * cma * y * z

yast = 2 * ast * y

zast = 0

ydfc = dfc * y

zdfc = dfc * z

y = yesf + ycma + yast + ydfc

z = zesf + zcma + zast + zdfc

yp = 240 + dhz + esc * y

zp = 240 + esc * z

LINE (yp, zp)-(yp + 1, zp + 1), 15, BF

NEXT i

LINE (0, 0)-(479, 479), , B

LOCATE 14, 65: PRINT "sph ="; eesf

LOCATE 15, 65: PRINT "cma ="; ccma

LOCATE 16, 65: PRINT "ast ="; aast

LOCATE 17, 65: PRINT "dfc ="; ddfc

DO: LOOP WHILE INKEY$ = ""

LOOP