n++

n--

b=

a=

bunsi = 572 (slider from -5 to 1000)
bunbo: 209
a: bunsi / bunbo
cf = ContinuedFraction(a, true)
l1 = Split(cf, {"[", "]", ",", ";"})
l2 = If(Last[l1] ≟ {"\ldots"}, Take[l1, 1, Length[l1] - 1], If[Last[l1] ≟ {"1"}, Append[Take[l1, 1, Length[l1] - 2], Text[toNumbers[Element[l1, Length[l1] - 1]] + 1]], l1])
l3 = Sequence(toNumbers[Element[l2, k]], k, 1, Length[l2])
l4 = Sequence({{Element[l3, i], 1}, {1, 0}}, i, 1, Length[l3])
l5 = Sequence(Product[Take[l4, 1, k]], k, 1, Length[l4])
l6 = Sequence(Element[Transpose[Element[l5, k]], 1], k, 1, Length[l5])
n = 5 (slider from 0 to Length[l3], step 1)
dn = Append(1, Sequence[(((a * Element[l6, k, 2]) - Element[l6, k, 1]) * (-1)^(k - 1)), k, 1, Length[l6] - 1])
xeven = Sequence(Sum[Sequence[(Element[l3, (2 * k) - 1] * Element[dn, (2 * k) - 1]), k, 1, m]], m, 1, floor((Length[l3] + 1) / 2))
xodd: xeven
yodd = Append(1, Sequence[1 - Sum[Sequence[(Element[l3, (2 * k)] * Element[dn, (2 * k)]), k, 1, m]], m, 1, floor(Length[l3] / 2)])
yeven: yodd
xn = Take(Append[0, Flatten[Sequence[{Element[xeven, k], Element[xodd, k]}, k, 1, Length[xeven]]]], 1, Length[l3])
yn = Take(Flatten[Sequence[{Element[yodd, k], Element[yeven, k]}, k, 1, Length[yodd]]], 1, Length[l3])
allpts = Zip((a, b), a, xn, b, yn)
rectangle = PolyLine((0, 0), (0, 1), (a, 1), (a, 0), (0, 0))
steps = Sequence(If[Mod[i, 2] ≟ 1, verticalsegs[Element[allpts, i], Element[dn, i], Element[l3, i]], horizontalsegs[Element[allpts, i], Element[dn, i], Element[l3, i]]], i, 1, n)
positive = If(n > 0, true, false)
arc1 = CircumcircleArc((0, 0), (-0.1, 0.5), (0, 1))
arc2 = CircumcircleArc((0, 1), (a / 2, 1.1), (a, 1))
InputBox1 = Textfield(bunbo)
InputBox2 = Textfield(bunsi)
label2 = Text(bunsi, (a / 2, 1.08))
label1 = Text(bunbo, (-0.1, 0.5), false, true, 0, 0)
amari = Append(Append[bunsi, (dn * bunbo)], 0)
text2 = Sequence(Text[" → (" + (Element[amari, k]) + "," + (Element[amari, k + 1]) + ")=(" + (Element[amari, k + 1]) + "," + (Element[amari, k + 2]) + ")", (0, 0), true, true], k, 1, n)
text1 = Sequence(Text[Element[amari, k] + "=" + (Element[l3, k]) + "\times" + (Element[amari, k + 1]) + "+" + (Element[amari, k + 2]), (0, 0), true, true], k, 1, n)
text3 = Text(" → (" + (Element[amari, n]) + "," + (Element[amari, n + 1]) + ")=" + (Element[amari, n + 1]) + " \quad        [G.C.M.]", (0, 0), true, true)
text4 = If(n ≟ Length[l3], Append[Take[text2, 1, Length[l3] - 1], text3], text2)
text5 = TableText({text1, text4}, "v")

Tool: mkptsonarc
mkptsonarc[ <Point>, <Circle>, <Point>, <Number>, <Number> ]
Input: A, c, B, delta, M
Output: ptsonarc

D = Center(c)
Na: ceil(c / delta)
Narc: (1 / 2 * (Na - M - abs(Na - M))) + M
ptsonarc = If(Defined[Intersect[c, ((A - D) * ℯ^((ί * Angle[A, D, B] / 2))) + D]], Sequence[((A - D) * ℯ^(((ί * k) * Angle[A, D, B] / Narc))) + D, k, 0, Narc - 1], Sequence[((A - D) * ℯ^((((-ί) * k) * Angle[B, D, A] / Narc))) + D, k, 0, Narc - 1])

Tool: mkptsonseg
mkptsonseg[ <Point>, <Point>, <Number>, <Number> ]
Input: A, B, delta, M
Output: ptsonseg

f = Segment(A, B)
Ns: ceil(f / delta)
N: (1 / 2 * (Ns - M - abs(Ns - M))) + M
ptsonseg = Sequence(((1 - k / N) * ToComplex[A]) + (k / N * ToComplex[B]), k, 0, N - 1)

Tool: toNumbers
toNumbers("text")
Input: text1
Output: m1

292

m1 = Element(Sum[Sequence[((TextToUnicode[Element[text1, k]] - 48) * 10^(Length[text1] - k)), k, 1, Length[text1]]], 1)

Tool: ford
ford[ <List> ]
Input: p
Output: d

p: {2, 3}
d = Circle(Point[{Element[p, 1] / Element[p, 2], 1 / 2 / Element[p, 2]^(2)}], 1 / 2 / Element[p, 2]^(2))

Tool: verticalsegs
A,d,m
Input: A, d, m
Output: l8

m: 3
d: 0.5
A: (2, 3)
l8 = Sequence(Segment[((d * k) + x(A), y(A)), ((d * k) + x(A), (-d) + y(A))], k, 1, m)

Tool: horizontalsegs
A,m,d
Input: A, d, m
Output: l9

m: 3
d: 0.5
A: (2, 3)
l9 = Sequence(Segment[(x(A), y(A) - (d * k)), (x(A) + d, ((-d) * k) + y(A))], k, 1, m)