! MANDELBROT SET IN A PSEUDO 3D VIEW

!THE "CLIFFS" REPRESENT HOW FAST YOU FALL AWAY FROM THE M-SET.

!THE "CLIFF FLOOR" IS SET AT n=5,

!WHILE THE M-SET "PLATEAU" IS SET AT n=31.

!

!DEEP THOUGHT QUESTION:

!WHICH WAY WOULD YOU RATHER "CLIMB" UP TO THE PLATEAU?

!

SET MODE "graphics"

ASK PIXELS hpix,vpix

LET ratio=hpix/vpix

SET WINDOW -8*ratio,4*ratio,-2,2

SET COLOR "BLACK"

FOR j=-300 to 150

FOR k = -300 to 300

LET x = 0

LET y = 0

FOR n=1 to 30

LET x1 = x*x - y*y + j/150

LET y1 = 2*x*y + k/150

LET r2 = x1*x1 + y1*y1

IF r2>4 THEN EXIT FOR

LET x = x1

LET y = y1

NEXT n

!PLOT A PSEUDO 3D VIEW, USING n AS THE THIRD VARIABLE.

!ONLY "FRONT CLIFF" POINTS ARE PLOTTED

!unless they correspond to the M-set "butt" with cr>.25.

IF (k<=0 AND n>5) THEN PLOT 5*j/150 + 1.7*k/150,k/150 +n/60

IF (k>0 AND n=31) THEN PLOT 5*j/150 + 1.7*k/150,k/150 +n/60

IF (k>0 AND n>5 AND j>37) THEN PLOT 5*j/150 + 1.7*k/150,k/150 +n/60

NEXT k

NEXT j

END