Pythagorase puu fraktal

A = (8, -6)
B = (12, -6)
hulknurk1, f, g, h, i, C, D = Polygon(A, B, 4)
D' = Rotate(D, (-(45°)), C)
α = Angle(D', C, D)
j = Line(C, D')
C' = Rotate(C, 45°, D)
β = Angle(C, D, C')
k = Line(C', D)
E = Intersect(k, j)
t1, c, e, d = Polygon(E, D, C)
hulknurk2, l, m, n_1, p, F, G = Polygon(E, C, 4)
hulknurk3, q, r, s, t, H, I = Polygon(D, E, 4)
q1, t2, q2 = Tööriist1(G, F)
q3, t3, q4 = Tööriist1(I, H)
J = (6, 4)
K = (8, 4)
L = (12, 4)
M = (14, 4)
q5, t4, q6 = Tööriist1(J, K)
q7, t5, q8 = Tööriist1(L, M)
N = (16, 2)
O = Point(xAxis)
P = (4, 2)
Q = Point(xAxis)
q9, t6, q10 = Tööriist1(N, O)
q11, t7, q12 = Tööriist1(Q, P)
R = (6, 6)
S = (5, 5)
T = (8, 6)
U = (9, 5)
V = (12, 6)
W = (11, 5)
Z = (14, 6)
A_1 = (15, 5)
B_1 = (17, 3)
C_1 = (18, 2)
D_1 = Point(xAxis)
E_1 = (17, -1)
F_1 = (3, 3)
G_1 = (2, 2)
H_1 = Point(xAxis)
I_1 = (3, -1)
q13, t8, q14 = Tööriist1(T, U)
q15, t9, q16 = Tööriist1(S, R)
q17, t10, q18 = Tööriist1(W, V)
q19, t11, q20 = Tööriist1(Z, A_1)
q21, t12, q22 = Tööriist1(B_1, C_1)
q23, t13, q24 = Tööriist1(D_1, E_1)
q25, t14, q26 = Tööriist1(G_1, F_1)
q27, t15, q28 = Tööriist1(I_1, H_1)
J_1 = Point(xAxis)
K_1 = (1, -1)
L_1 = (2, -2)
M_1 = (3, -2)
N_1 = (1, 3)
O_1 = (1, 2)
P_1 = (2, 4)
Q_1 = (3, 4)
R_1 = (4, 6)
S_1 = (4, 5)
T_1 = (5, 7)
U_1 = (6, 7)
V_1 = (8, 7)
W_1 = (9, 7)
Z_1 = (11, 7)
A_2 = (12, 7)
B_2 = (14, 7)
C_2 = (15, 7)
D_2 = (16, 6)
E_2 = (16, 5)
F_2 = (17, 4)
G_2 = (18, 4)
H_2 = (19, 3)
I_2 = (19, 2)
J_2 = Point(xAxis)
K_2 = (19, -1)
L_2 = (17, -2)
M_2 = (18, -2)
q29, t16, q30 = Tööriist1(M_2, L_2)
q31, t17, q32 = Tööriist1(J_2, K_2)
q33, t18, q34 = Tööriist1(H_2, I_2)
q35, t19, q36 = Tööriist1(F_2, G_2)
q37, t20, q38 = Tööriist1(D_2, E_2)
q39, t21, q40 = Tööriist1(B_2, C_2)
q41, t22, q42 = Tööriist1(Z_1, A_2)
q43, t23, q44 = Tööriist1(V_1, W_1)
q45, t24, q46 = Tööriist1(T_1, U_1)
q47, t25, q48 = Tööriist1(S_1, R_1)
q49, t26, q50 = Tööriist1(P_1, Q_1)
q51, t27, q52 = Tööriist1(O_1, N_1)
q53, t28, q54 = Tööriist1(K_1, J_1)
q55, t29, q56 = Tööriist1(M_1, L_1)
N_2 = (10, 6)
O_2 = (9.979207595558501, 5.009605550367249)
q57, t30, q58 = Tööriist1(N_2, O_2)
q59, t31, q60 = Tööriist1(O_2, N_2)
P_2 = (16.5, -2.5)
Q_2 = (17, -3)
R_2 = (18, -3)
S_2 = (18.5, -2.5)
T_2 = (19.5, -1.5)
U_2 = (20, -1)
V_2 = (19.5, 0.5)
W_2 = (20, 0)
q61, t32, q62 = Tööriist1(Q_2, P_2)
q63, t33, q64 = Tööriist1(S_2, R_2)
q65, t34, q66 = Tööriist1(U_2, T_2)
q67, t35, q68 = Tööriist1(V_2, W_2)
Z_2 = (20, 2)
A_3 = (19.5, 1.5)
B_3 = (19.5, 3.5)
C_3 = (20, 3)
D_3 = (18, 5)
E_3 = (18.5, 4.5)
F_3 = (17, 5)
G_3 = (16.5, 4.5)
H_3 = (16.5, 6.5)
I_3 = (17, 6)
q69, t36, q70 = Tööriist1(H_3, I_3)
q71, t37, q72 = Tööriist1(F_3, G_3)
q73, t38, q74 = Tööriist1(G_3, F_3)
q75, t39, q76 = Tööriist1(D_3, E_3)
q77, t40, q78 = Tööriist1(B_3, C_3)
q79, t41, q80 = Tööriist1(Z_2, A_3)
J_3 = (15, 8)
K_3 = (15.5, 7.5)
L_3 = (14, 8)
M_3 = (13.5, 7.5)
N_3 = (12, 8)
O_3 = (12.5, 7.5)
P_3 = (11, 8)
Q_3 = (10.5, 7.5)
R_3 = (9, 8)
S_3 = (9.5, 7.5)
T_3 = (8, 8)
U_3 = (7.5, 7.5)
q81, t42, q82 = Tööriist1(J_3, K_3)
q83, t43, q84 = Tööriist1(M_3, L_3)
q85, t44, q86 = Tööriist1(N_3, O_3)
q87, t45, q88 = Tööriist1(Q_3, P_3)
q89, t46, q90 = Tööriist1(R_3, S_3)
q91, t47, q92 = Tööriist1(U_3, T_3)
V_3 = (6, 8)
W_3 = (6.5, 7.5)
Z_3 = (5, 8)
A_4 = (4.5, 7.5)
B_4 = (3.5, 6.5)
C_4 = (3, 6)
D_4 = (3, 5)
E_4 = (3.5, 4.5)
F_4 = (2, 5)
G_4 = (1.5, 4.5)
q93, t48, q94 = Tööriist1(V_3, W_3)
q95, t49, q96 = Tööriist1(A_4, Z_3)
q97, t50, q98 = Tööriist1(C_4, B_4)
q99, t51, q100 = Tööriist1(E_4, D_4)
q101, t52, q102 = Tööriist1(D_4, E_4)
q103, t53, q104 = Tööriist1(G_4, F_4)
H_4 = (0.5, 3.5)
I_4 = Point(yAxis)
J_4 = Point(yAxis)
K_4 = (0.5, 1.5)
L_4 = (0.5, 0.5)
N_4 = Point(yAxis)
O_4 = (0.5, -1.5)
M_4 = Intersect(xAxis, yAxis)
q105, t54, q106 = Tööriist1(I_4, H_4)
q107, t55, q108 = Tööriist1(K_4, J_4)
q109, t56, q110 = Tööriist1(M_4, L_4)
q111, t57, q112 = Tööriist1(O_4, N_4)
P_4 = (1.5, -2.5)
Q_4 = (2, -3)
R_4 = (3, -3)
S_4 = (3.5, -2.5)
q113, t58, q114 = Tööriist1(Q_4, P_4)
q115, t59, q116 = Tööriist1(S_4, R_4)
T_4 = (16, -2.5)
U_4 = (16, -3)
V_4 = (16.5, -3.5)
W_4 = (17, -3.5)
Z_4 = (18, -3.5)
A_5 = (18.5, -3.5)
B_5 = (19, -3)
C_5 = (19, -2.5)
D_5 = (19.5, -2)
E_5 = (20, -2)
F_5 = (20.5, -1)
G_5 = (20.5, -1.5)
q117, t60, q118 = Tööriist1(U_4, T_4)
q119, t61, q120 = Tööriist1(W_4, V_4)
q121, t62, q122 = Tööriist1(A_5, Z_4)
q123, t63, q124 = Tööriist1(C_5, B_5)
q125, t64, q126 = Tööriist1(E_5, D_5)
q127, t65, q128 = Tööriist1(F_5, G_5)
H_5 = (19.5, 4)
I_5 = (20, 4)
J_5 = (20.5, 3.5)
K_5 = (20.5, 3)
L_5 = (20.5, 2)
M_5 = (20.5, 1.5)
N_5 = (20.5, 0.5)
O_5 = Point(xAxis)
P_5 = (19.5, 1)
Q_5 = (20, 1)
q129, t66, q130 = Tööriist1(H_5, I_5)
q131, t67, q132 = Tööriist1(J_5, K_5)
q133, t68, q134 = Tööriist1(L_5, M_5)
q135, t69, q136 = Tööriist1(Q_5, P_5)
q137, t70, q138 = Tööriist1(P_5, Q_5)
q139, t71, q140 = Tööriist1(N_5, O_5)
R_5 = (19, 5)
S_5 = (19, 4.5)
T_5 = (18, 5.5)
U_5 = (18.5, 5.5)
V_5 = (16.5, 5.5)
W_5 = (17, 5.5)
Z_5 = (16, 4.5)
A_6 = (17.5, 5)
B_6 = (17.5, 4.5)
C_6 = (16.5, 4)
D_6 = (17.5, 6.5)
E_6 = (17.5, 6)
F_6 = (16.5, 7)
G_6 = (17, 7)
q141, t72, q142 = Tööriist1(F_6, G_6)
q143, t73, q144 = Tööriist1(D_6, E_6)
q145, t74, q146 = Tööriist1(T_5, U_5)
q147, t75, q148 = Tööriist1(R_5, S_5)
q149, t76, q150 = Tööriist1(V_5, W_5)
q151, t77, q152 = Tööriist1(Z_5, E_2)
q153, t78, q154 = Tööriist1(F_2, C_6)
q155, t79, q156 = Tööriist1(A_6, B_6)
H_6 = (16, 8)
I_6 = (16.0038407659236, 7.5063765301954435)
J_6 = (14.996602672088075, 8.504416102626074)
K_6 = (15.497922088654615, 8.499816841923629)
L_6 = (13.497243683090904, 8.513614624030964)
M_6 = (13.998563099657442, 8.499816841923629)
N_6 = (13, 8)
O_6 = (13.000523527226811, 7.5063765301954435)
P_6 = (12.503803371362716, 8.509015363328519)
Q_6 = (12.002483954796178, 8.509015363328519)
q157, t80, q158 = Tööriist1(H_6, I_6)
q159, t81, q160 = Tööriist1(J_6, K_6)
q161, t82, q162 = Tööriist1(L_6, M_6)
q163, t83, q164 = Tööriist1(N_6, O_6)
q165, t84, q166 = Tööriist1(O_6, N_6)
q167, t85, q168 = Tööriist1(Q_6, P_6)
R_6 = (10.498525705096569, 8.499816841923625)
S_6 = (10.999845121663107, 8.499816841923625)
T_6 = (10, 8)
U_6 = (9.997206288530029, 7.50637653019544)
V_6 = (8.999166716099396, 8.50441610262607)
W_6 = (9.495886871963489, 8.50441610262607)
Z_6 = (7.499807727102222, 8.499816841923625)
A_7 = (7.99192862226387, 8.499816841923625)
B_7 = (7, 8)
C_7 = (6.9984883105356825, 7.50637653019544)
q169, t86, q170 = Tööriist1(R_6, S_6)
q171, t87, q172 = Tööriist1(T_6, U_6)
q173, t88, q174 = Tööriist1(U_6, T_6)
q175, t89, q176 = Tööriist1(V_6, W_6)
q177, t90, q178 = Tööriist1(Z_6, A_7)
q179, t91, q180 = Tööriist1(B_7, C_7)
q181, t92, q182 = Tööriist1(C_7, B_7)
D_7 = (6.000448738105049, 8.504416102626067)
E_7 = (6.492569633266697, 8.504416102626067)
F_7 = (4.49649048840543, 8.504416102626067)
G_7 = (5.002409165674415, 8.513614624030957)
H_7 = (4, 8)
J_7 = (3, 7)
L_7 = (2.4958120828417174, 6.499138436359915)
M_7 = (2.4958120828417174, 6.007017541198268)
q183, t93, q184 = Tööriist1(F_7, G_7)
q189, t96, q190 = Tööriist1(M_7, L_7)
I_7 = (3.5, 7)
K_7 = (4, 7.5)
q185, t94, q186 = Tööriist1(K_7, H_7)
q187, t95, q188 = Tööriist1(J_7, I_7)
N_7 = (1.5, 5.5)
O_7 = (2, 5.5)
P_7 = (1, 5)
Q_7 = (1, 4.5)
q191, t97, q192 = Tööriist1(N_7, O_7)
q193, t98, q194 = Tööriist1(Q_7, P_7)
R_7 = Point(yAxis)
S_7 = (0.49941215660730515, 4.000817265920403)
T_7 = (-0.5025056463609195, 3.5018865381265107)
U_7 = (-0.5025056463609195, 3.0049839840228376)
q195, t99, q196 = Tööriist1(R_7, S_7)
q197, t100, q198 = Tööriist1(U_7, T_7)
V_7 = (-0.5016256920238217, 2.0022649056395165)
W_7 = (-0.5016256920238217, 1.5009764169351998)
Z_7 = Point(yAxis)
A_8 = (0.4982848572534085, 1.0050207844936947)
B_8 = (-0.5016256920238217, 0.5037322957893778)
C_8 = Point(xAxis)
q199, t101, q200 = Tööriist1(W_7, V_7)
q201, t102, q202 = Tööriist1(Z_7, A_8)
q203, t103, q204 = Tööriist1(A_8, Z_7)
q205, t104, q206 = Tööriist1(C_8, B_8)
D_8 = (-0.5017461375658178, -0.9990522770598103)
F_8 = Point(yAxis)
G_8 = (0.49939422394933114, -1.9950453873589415)
q209, t106, q210 = Tööriist1(G_8, F_8)
E_8 = (-0.5, -1.5)
q207, t105, q208 = Tööriist1(E_8, D_8)
H_8 = (1, -2.5)
I_8 = (1, -3)
J_8 = (1.5, -3.5)
K_8 = (2, -3.5)
q211, t107, q212 = Tööriist1(I_8, H_8)
q213, t108, q214 = Tööriist1(K_8, J_8)
L_8 = (4, -2.5)
M_8 = (4, -3)
q215, t109, q216 = Tööriist1(L_8, M_8)
N_8 = (3, -3.5)
O_8 = (3.5, -3.5)
q217, t110, q218 = Tööriist1(O_8, N_8)
n = 7 (slider from 0 to 7, step 1)

Tool: Tööriist1
Input: D, C
Output: hulknurk3, t1, hulknurk2

D' = Rotate(D, (-(45°)), C)
j = Line(C, D')
C' = Rotate(C, 45°, D)
k = Line(C', D)
E = Intersect(k, j)
t1, c, e, d = Polygon(E, D, C)
hulknurk2, l, m, n, p, F, G = Polygon(E, C, 4)
hulknurk3, q, r, s, t, H, I = Polygon(D, E, 4)