Autoriser A à avoir des coordonnées non entières: de l'algo d'Euclide à celui des fractions continues

$A%v$

Zoom

Dézoom

a = false
A = (440, 100)
C1 = If(a, LaTeX["\theta"], LaTeX["q"])
D1 = If(a, LaTeX["\rho"], LaTeX["r"])
A_0 = If(a, (Max[abs(x(A)), abs(y(A))], Min[abs(x(A)), abs(y(A))]), (floor(Max[abs(x(A)), abs(y(A))]), floor(Min[abs(x(A)), abs(y(A))])))
A2: x(A_0)
B2: y(A_0)
C2 = Div(A2, B2)
D2 = Mod(A2, B2)
A3: B2
B3: D2
C3 = Div(A3, B3)
D3 = Mod(A3, B3)
A4: B3
B4: D3
C4 = Div(A4, B4)
D4 = Mod(A4, B4)
A5: B4
B5: D4
C5 = Div(A5, B5)
D5 = Mod(A5, B5)
A6: B5
B6: D5
C6 = Div(A6, B6)
D6 = Mod(A6, B6)
A7: B6
B7: D6
C7 = Div(A7, B7)
D7 = Mod(A7, B7)
A8: B7
B8: D7
C8 = Div(A8, B8)
D8 = Mod(A8, B8)
A9: B8
B9: D8
C9 = Div(A9, B9)
D9 = Mod(A9, B9)
A10: B9
B10: D9
C10 = Div(A10, B10)
D10 = Mod(A10, B10)
A11: B10
B11: D10
C11 = Div(A11, B11)
D11 = Mod(A11, B11)
A12: B11
B12: D11
C12 = Div(A12, B12)
D12 = Mod(A12, B12)
liste3: {C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12}
liste4: {D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12}
N = Length(RemoveUndefined[liste4])
ta: IsInteger[x(A)] ∧ IsInteger[y(A)]
E1 = 0
E2: E1 + 1
E3: E2 + 1
E4: E3 + 1
E5: E4 + 1
E6: E5 + 1
E7: E6 + 1
E8: E7 + 1
E9: E8 + 1
E10: E9 + 1
E11: E10 + 1
F1 = true
E12: E11 + 1
F2: ¬F1
F3: ¬F2
F4: ¬F3
F5: ¬F4
F6: ¬F5
F7: ¬F6
F8: ¬F7
F9: ¬F8
F10: ¬F9
F11: ¬F10
F12: ¬F11
O = (0, 0)
n = 4 (slider from 0 to N, step 1)
G2 = Sequence(Polygon[(If[F1, A2, B2], If[F2, A2, B2]) - (((k - If[F1, 1, 0]) * B2) * (If[F1, 1, 0], If[F2, 1, 0])), (If[F1, A2, B2], If[F2, A2, B2]) - (((k - If[F2, 1, 0]) * B2) * (If[F1, 1, 0], If[F2, 1, 0])), 4], k, 1, C2)
G3 = Sequence(Polygon[(If[F2, A3, B3], If[F3, A3, B3]) - (((k - If[F2, 1, 0]) * B3) * (If[F2, 1, 0], If[F3, 1, 0])), (If[F2, A3, B3], If[F3, A3, B3]) - (((k - If[F3, 1, 0]) * B3) * (If[F2, 1, 0], If[F3, 1, 0])), 4], k, 1, C3)
G4 = Sequence(Polygon[(If[F3, A4, B4], If[F4, A4, B4]) - (((k - If[F3, 1, 0]) * B4) * (If[F3, 1, 0], If[F4, 1, 0])), (If[F3, A4, B4], If[F4, A4, B4]) - (((k - If[F4, 1, 0]) * B4) * (If[F3, 1, 0], If[F4, 1, 0])), 4], k, 1, C4)
G5 = Sequence(Polygon[(If[F4, A5, B5], If[F5, A5, B5]) - (((k - If[F4, 1, 0]) * B5) * (If[F4, 1, 0], If[F5, 1, 0])), (If[F4, A5, B5], If[F5, A5, B5]) - (((k - If[F5, 1, 0]) * B5) * (If[F4, 1, 0], If[F5, 1, 0])), 4], k, 1, C5)
G8 = Sequence(Polygon[(If[F7, A8, B8], If[F8, A8, B8]) - (((k - If[F7, 1, 0]) * B8) * (If[F7, 1, 0], If[F8, 1, 0])), (If[F7, A8, B8], If[F8, A8, B8]) - (((k - If[F8, 1, 0]) * B8) * (If[F7, 1, 0], If[F8, 1, 0])), 4], k, 1, C8)
G9 = Sequence(Polygon[(If[F8, A9, B9], If[F9, A9, B9]) - (((k - If[F8, 1, 0]) * B9) * (If[F8, 1, 0], If[F9, 1, 0])), (If[F8, A9, B9], If[F9, A9, B9]) - (((k - If[F9, 1, 0]) * B9) * (If[F8, 1, 0], If[F9, 1, 0])), 4], k, 1, C9)
G10 = Sequence(Polygon[(If[F9, A10, B10], If[F10, A10, B10]) - (((k - If[F9, 1, 0]) * B10) * (If[F9, 1, 0], If[F10, 1, 0])), (If[F9, A10, B10], If[F10, A10, B10]) - (((k - If[F10, 1, 0]) * B10) * (If[F9, 1, 0], If[F10, 1, 0])), 4], k, 1, C10)
G11 = Sequence(Polygon[(If[F10, A11, B11], If[F11, A11, B11]) - (((k - If[F10, 1, 0]) * B11) * (If[F10, 1, 0], If[F11, 1, 0])), (If[F10, A11, B11], If[F11, A11, B11]) - (((k - If[F11, 1, 0]) * B11) * (If[F10, 1, 0], If[F11, 1, 0])), 4], k, 1, C11)
G12 = Sequence(Polygon[(If[F11, A12, B12], If[F12, A12, B12]) - (((k - If[F11, 1, 0]) * B12) * (If[F11, 1, 0], If[F12, 1, 0])), (If[F11, A12, B12], If[F12, A12, B12]) - (((k - If[F12, 1, 0]) * B12) * (If[F11, 1, 0], If[F12, 1, 0])), 4], k, 1, C12)
gcd = GCD(A2, B2)
lastcarre, b, c, d, e, B, C = Polygon(O, O + (gcd, 0), 4)
texte1: "PGCD(" + (LaTeX[A2]) + ";" + (LaTeX[B2]) + ")=" + (LaTeX[gcd]) + "=\text{côté du dernier carré du puzzle}"
A1 = If(a, LaTeX["\alpha"], LaTeX["a"])
liste1: {A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12}
B1 = If(a, LaTeX["\beta"], LaTeX["b"])
liste2: {B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12}
abqr1 = First(liste1, Min[n + 1, N])
abqr2 = First(liste2, Min[n + 1, N])
abqr3 = First(liste3, Min[n + 1, N])
abqr4 = First(liste4, Min[n + 1, N])
abqr = TableText({abqr1, abqr2, abqr3, abqr4}, "v|_")
L = Sequence(Element[liste3, k], k, 2, n)
texte2 = LaTeX(L, true, true)
G6 = Sequence(Polygon[(If[F5, A6, B6], If[F6, A6, B6]) - (((k - If[F5, 1, 0]) * B6) * (If[F5, 1, 0], If[F6, 1, 0])), (If[F5, A6, B6], If[F6, A6, B6]) - (((k - If[F6, 1, 0]) * B6) * (If[F5, 1, 0], If[F6, 1, 0])), 4], k, 1, C6)
G7 = Sequence(Polygon[(If[F6, A7, B7], If[F7, A7, B7]) - (((k - If[F6, 1, 0]) * B7) * (If[F6, 1, 0], If[F7, 1, 0])), (If[F6, A7, B7], If[F7, A7, B7]) - (((k - If[F7, 1, 0]) * B7) * (If[F6, 1, 0], If[F7, 1, 0])), 4], k, 1, C7)
poly1, o, f, g, h = Polygon(O, (A2, 0), (A2, B2), (0, B2))