The Mandelbrot set
Author: prof. Alessandro Zampa

The Mandelbrot set

Draw

Clear

C = (-0.725908141592142, -1.860898122355318)
B = (-1.924597277818503, -1.860898122355318)
dx: x(C) - x(B)
A = (-1.924597277818503, -1.699670928593878)
dy: y(A) - y(B)
xx = 7727 (slider from 0 to 10240, step 1)
i = (0, 1)
Z: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] - 160) / 100 * i)
Y: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] - 128) / 100 * i)
X: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] - 96) / 100 * i)
W: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] - 64) / 100 * i)
V: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] - 32) / 100 * i)
U: (Mod[xx, 320] - 250) / 100 + (Div[xx, 320] / 100 * i)
T: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] + 32) / 100 * i)
S: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] + 64) / 100 * i)
R: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] + 96) / 100 * i)
Q: (Mod[xx, 320] - 250) / 100 + ((Div[xx, 320] + 128) / 100 * i)
L_0: {Q, R, S, T, U, V, W, X, Y, Z}
L_1 = Sequence((Element[L_0, i] * Element[L_0, i]) + Element[L_0, i], i, 1, 10)
L_2 = Sequence((Element[L_1, i] * Element[L_1, i]) + Element[L_0, i], i, 1, 10)
L_3 = Sequence((Element[L_2, i] * Element[L_2, i]) + Element[L_0, i], i, 1, 10)
L_4 = Sequence((Element[L_3, i] * Element[L_3, i]) + Element[L_0, i], i, 1, 10)
L_5 = Sequence((Element[L_4, i] * Element[L_4, i]) + Element[L_0, i], i, 1, 10)
L_6 = Sequence((Element[L_5, i] * Element[L_5, i]) + Element[L_0, i], i, 1, 10)
L_7 = Sequence((Element[L_6, i] * Element[L_6, i]) + Element[L_0, i], i, 1, 10)
L_8 = Sequence((Element[L_7, i] * Element[L_7, i]) + Element[L_0, i], i, 1, 10)
L_9 = Sequence((Element[L_8, i] * Element[L_8, i]) + Element[L_0, i], i, 1, 10)
L_{10} = Sequence((Element[L_9, i] * Element[L_9, i]) + Element[L_0, i], i, 1, 10)
L_{11} = Sequence((Element[L_{10}, i] * Element[L_{10}, i]) + Element[L_0, i], i, 1, 10)
L_{12} = Sequence((Element[L_{11}, i] * Element[L_{11}, i]) + Element[L_0, i], i, 1, 10)
L_{13} = Sequence((Element[L_{12}, i] * Element[L_{12}, i]) + Element[L_0, i], i, 1, 10)
L_{14} = Sequence((Element[L_{13}, i] * Element[L_{13}, i]) + Element[L_0, i], i, 1, 10)
L_{15} = Sequence((Element[L_{14}, i] * Element[L_{14}, i]) + Element[L_0, i], i, 1, 10)
L_{16} = Sequence((Element[L_{15}, i] * Element[L_{15}, i]) + Element[L_0, i], i, 1, 10)
L_{17} = Sequence((Element[L_{16}, i] * Element[L_{16}, i]) + Element[L_0, i], i, 1, 10)
L_{18} = Sequence((Element[L_{17}, i] * Element[L_{17}, i]) + Element[L_0, i], i, 1, 10)
L_{19} = Sequence((Element[L_{18}, i] * Element[L_{18}, i]) + Element[L_0, i], i, 1, 10)
L_{20} = Sequence((Element[L_{19}, i] * Element[L_{19}, i]) + Element[L_0, i], i, 1, 10)
b = Sequence(If[(¬Defined[Element[L_{20}, i]]) ∨ (Length[Element[L_{20}, i]] > 2), 1, 0], i, 1, 10)
g = Sequence((If[(¬Defined[Element[L_{20}, i]]) ∨ (Length[Element[L_{20}, i]] > 2), 1, 0] + If[(¬Defined[Element[L_{19}, i]]) ∨ (Length[Element[L_{19}, i]] > 2), 1, 0]) / 2, i, 1, 10)
r = Sequence((If[(¬Defined[Element[L_{20}, i]]) ∨ (Length[Element[L_{20}, i]] > 2), 1, 0] + If[(¬Defined[Element[L_{19}, i]]) ∨ (Length[Element[L_{19}, i]] > 2), 1, 0] + If[(¬Defined[Element[L_{18}, i]]) ∨ (Length[Element[L_{18}, i]] > 2), 1, 0]) / 3, i, 1, 10)
p: floor((xx * 100 / 10240))
D = (-0.725908141592142, -1.699670928593878)
poli1, a, b_1, c, d = Polygon(A, B, C, D)
E: (x(A) + (1.5 * dx / 74), y(A) - (1.5 * dy / 10))
G: (x(B) + (dx * (1.5 + (xx * 71 / 10240)) / 74), y(B) + (1.5 * dy / 10))
H: (x(B) + (dx * (1.5 + (xx * 71 / 10240)) / 74), y(A) - (1.5 * dy / 10))
F: (x(B) + (1.5 * dx / 74), y(B) + (1.5 * dy / 10))
poli2, e, f, g_1, h = Polygon(E, F, G, H)
testo2: "" + p + " %"