REM *** MAD TEDDY'S M-SET ZOOM PROGRAM *** REM Zooming in on the "Love Canal", starting from the entire M-set SCREEN 12: REM graphics, 640x480 iterationlimit = 250 numberofframes = 100 REM coordinates for first frame ylow1 = -1.25 yhigh1 = 1.25 xlow1 = -2.15 xhigh1 = xlow1 + (yhigh1 - ylow1) * 4 / 3 REM coordinates for final frame ylow2 = .8271696 yhigh2 = .8272704 xlow2 = -.2351922 xhigh2 = xlow2 + (yhigh2 - ylow2) * 4 / 3 REM dimensions of first frame xlowdelta = xlow2 - xlow1 ylowdelta = ylow2 - ylow1 REM dimensions of final frame xhighdelta = xhigh2 - xhigh1 yhighdelta = yhigh2 - yhigh1 k = LOG((yhigh1 - ylow1) / (yhigh2 - ylow2)) FOR frame = 0 TO numberofframes REM print frame number at bottom - three digits LOCATE 16, 16: PRINT "Frame "; IF frame < 100 THEN PRINT "0"; IF frame < 10 THEN PRINT "0"; PRINT RIGHT$(STR$(frame), LEN(STR$(frame)) - 1) lambda = frame / numberofframes z = 1 - EXP(-k * lambda) ylow = ylow1 + z * ylowdelta yhigh = yhigh1 + z * yhighdelta xlow = xlow1 + z * xlowdelta xhigh = xhigh1 + z * xhighdelta FOR i = 0 TO 239 FOR j = 0 TO 319 x = xlow + j * (xhigh - xlow) / 319 y = yhigh - i * (yhigh - ylow) / 239 xc = x: yc = y iterations = 0 rsquared = 0 DO UNTIL rsquared >= 4 OR iterations > iterationlimit u = x * x - y * y + xc v = 2 * x * y + yc rsquared = u * u + v * v x = u: y = v iterations = iterations + 1 LOOP IF rsquared >= 4 THEN PSET (j, i), 15: REM plots a white dot REM don't bother plotting a black dot if point is in M-set REM - just leave it as it is, black, and save a bit of time END IF NEXT j NEXT i BEEP a$ = "" DO: a$ = INKEY$: LOOP UNTIL a$ = " " CLS NEXT frame