Go

n = 0 (slider from -25 to 25, step 1)
e = 295 (slider from 0 to 500, step 0.05)
L: {(87.575467, 2.9187684), (-5.36731, 1.21986), (-4.50446, 1.65825), (-3.27981, 1.92988), (-1.6934, 2.03475), (-0.11417, 1.2995896), (0.21572, 2.16627), (0.50144, 2.73134), (0.74299, 2.99479), (0.94205, 3.82478), (0.43037, 3.15318), (-0.0554, 2.89984), (-0.51524, 3.06471), (-0.51452, 4.07258), (-0.47208, 6.94396), (-0.37731, 8.84311), (-0.23025, 9.77005), (-0.0844, 6.00572), (-0.0844, 6.00572), (-0.0844, 6.00573), (-0.0844, 6.00572), (-1.94877, -2.09644), (-1.94877, -2.09644), (-1.94877, -2.09645), (-1.94877, -2.09644), (-8.93864, -11.48973), (-5.46669, -11.47303), (-1.97282, -11.38903), (1.54293, -11.23772), (1.3751, -5.78813), (0.55048, -5.08286), (-0.28598, -3.97208), (-1.1343, -2.45574), (-2.37874, -1.22745), (-3.71458, -0.0472), (-5.33531, 1.16822), (-7.24091, 2.41899), (-9.8163, 3.96101), (-8.14125, 4.0086), (-6.3186, 3.9747), (-4.34834, 3.85929), (-2.65474997, 3.5027), (-0.80228, 2.78247), (1.08145997, 2.67362), (2.99648, 3.17619), (3.42126, 3.8376), (2.57127, 4.3808), (1.61828, 4.70075), (0.56231, 4.79748), (1.23755, 4.51308), (4.32468, 7.02095), (8.3298, 10.82332), (13.25295, 15.920202), (4.05421, 4.98262), (3.44407, 4.60684), (2.46974, 3.71835), (1.13123, 2.31719), (0.52011, 1.83571), (0.80582, 2.40743), (0.98147, 2.66665), (1.04705, 2.61341), (1.40203, 3.70317), (0.51292, 3.48969), (-0.33895, 5.11932), (-1.15355, 8.59206), (-1.75743, 10.87172), (-2.06631, 10.2337), (-2.21664, 8.88781), (-2.20841, 6.83406), (-1.34638, 2.38407), (-1.15723, -0.83409), (-1.12873, -4.42158), (-1.26087, -8.3784), (-2.17828, -14.58221), (-2.45161, -13.10108), (-2.53743, -10.72444), (-2.43574, -7.45231), (-1.17497, -3.15578), (-0.96219, -3.27766), (-0.65013, -3.01218), (-0.23878, -2.35935), (-0.24266, -2.31201), (-0.69089, -2.60736), (-1.08349, -2.73522), (-1.42046, -2.69558), (-0.85938, -1.4337), (-0.85937, -1.43371), (-0.85938, -1.433702), (-0.85937, -1.43371), (-0.0969, 1.34419), (-0.0969, 1.344192), (-0.0969, 1.34419), (-0.0969, 1.34419), (0.0316, 2.67966), (0.39198, 3.19468), (0.69814, 3.38252), (0.95009, 3.24314), (2.84484, 11.66942), (3.04362, 17.62434), (2.63564, 19.60202), (1.6209, 17.60246), (1.43095, 13.77292), (2.72947, 12.48494), (4.32488, 12.23744), (6.21716, 13.0304), (15.45329, 22.62071), (20.57007, 20.73488), (23.112953, 16.64649), (23.08197, 10.35554), (3.39917, 1.04451), (3.71094, 1.2273), (3.57406, 1.25708), (2.98855, 1.13387), (7.94008, 1.79153), (10.0745, 0.23663), (10.95702, -1.25751), (10.58769, -2.6909), (18.85441, -5.02446), (18.18579, -2.03644), (17.60769, 0.94883), (17.1201, 3.93133), (7.3984, 2.25227), (5.70042, 1.12825), (6.49476, 0.29513), (9.78142, -0.24709), (11.22581, -0.76525), (10.10673, -1.50507), (9.16778, -2.28026), (8.409, -3.09084), (1.02877, -0.22755), (0.75644, 0.43236), (0.57858, 1.20836), (0.49519, 2.10048), (1.34769, 3.51975), (2.39093, 3.04096), (2.99177, 2.13663), (3.15022, 0.80678), (4.05577, -0.88686), (5.17119, -2.5375), (5.97214, -4.00354), (6.45859, -5.28497), (7.15261, -5.63723), (7.48653, -4.71064), (6.84032, -3.2401), (5.21394, -1.22563), (4.30094, -0.78355), (4.76352, -2.11927), (4.79619, -3.21508), (4.39892, -4.07098), (4.13792, -5.82663), (4.53504, -9.2347), (5.3454, -13.59764), (6.56893, -18.91542), (1.22705, -3.67064), (1.22705, -3.67065), (1.22705, -3.67064), (1.22705, -3.67064), (0.10262, -7.43663), (0.10262, -7.43663), (0.10263, -7.43664), (0.10262, -7.43663), (0.10262, -7.43663), (0.10261, -7.43662), (0.10262, -7.43663), (0.10262, -7.43663), (1.89453, -2.81758), (1.89454, -2.81758), (1.89453, -2.81757), (1.89454, -2.81758), (3.31489, -4.70306), (3.42369, -4.47399), (3.12896, -3.73911), (2.43068, -2.49844), (2.78873, -2.29258), (2.25449, -1.14088), (2.65697, -0.2555), (3.99616, 0.36358), (3.79226, 0.39951), (1.8315, -0.0153), (0.24014, -0.5267), (-0.9818, -1.13479), (-1.30721, -0.86697), (-2.00014, -0.7941), (-2.43536, -0.63801), (-2.61287, -0.39872), (-5.42454, 0.1398), (-5.42393, 1.51624), (-5.58555, 2.95864), (-5.9094, 4.46697), (-2.0534, 1.69641), (-1.81772, 1.38922), (-1.38482, 0.93866), (-0.75469, 0.34475), (-0.28271, -1.50415), (-0.0997, -4.09546), (0.0842, -6.06128), (0.26912, -7.40161), (-0.0633, -19.583932), (-2.41374, -15.57403), (-5.06666, -12.70764), (-8.02201, -10.98475), (-11.64879, -9.34961), (-13.84875, -6.1715), (-13.75033, -2.28885), (-11.35353, 2.29837), (-1.32707, 0.81755), (-1.76522, 1.27592), (-1.97315, 1.55966), (-1.95086, 1.66878), (-1.92548, 1.66356), (-1.90403, 1.54544), (-1.66291, 1.25487), (-1.20215, 0.79185), (-1.09611, 0.74875), (-0.24588, 0.77595), (0.67457, 1.11237), (1.66523, 1.75804), (1.36396, 1.56623), (0.86335, 1.47775), (0.37126, 1.40924), (-0.11228, 1.36068), (-0.22546, 1.91695), (0.95089, 0.49129), (2.51986, -0.99088), (4.48148, -2.52956), (11.29024, -3.47151), (10.96695, 2.12863), (9.15291, 7.04877), (5.84811, 11.28892), (1.52804, 7.08666), (0.46621, 7.14258), (-0.60296, 8.01048), (-1.67945, 9.690372), (-1.00498, 5.18404), (-0.95851, 5.46587), (-0.80353, 5.09719), (-0.54004, 4.078), (-1.02263, 6.6935), (-1.51378, 5.86826), (-2.05955, 5.21238), (-2.65993, 4.72586), (-1.50073, 2.62027), (-1.96407, 3.90025), (-2.17263, 4.65346), (-2.12646, 4.87992), (-2.73273, 6.21855), (-2.17896, 3.94153), (-2.19642, 2.50631), (-2.7851, 1.91288), (-3.43665, 1.8226), (-3.99044, 1.49947), (-6.24668, 1.7101), (-10.20537, 2.45449), (-2.21978, 0.52301), (-2.21978, 0.52302), (-2.21978, 0.52301), (-2.21978, 0.52301), (-3.5081, -1.43682), (-3.5081, -1.43681), (-3.50809, -1.43682), (-3.5081, -1.43682), (-9.83461, -4.20894), (-6.13529, -3.21911), (-3.51998, -2.91833), (-1.98866, -3.30658), (-0.81799, -1.72305), (-1.10845, -2.05734), (-1.25346, -2.13354), (-1.25302, -1.95163), (-0.72989, -1.07555), (-0.72989, -1.07555), (-0.72989, -1.07555), (-0.72989, -1.07555), (0.62856, -1.23209), (0.62857, -1.23209), (0.62856, -1.2321), (0.62857, -1.23209), (1.50754, -2.72878), (2.24606, -3.78663), (2.68115, -4.34378), (2.8128, -4.40024), (5.89719, -9.41247), (6.2408, -10.56818), (5.84837, -10.44457), (4.71995, -9.04165), (2.55941, -6.737842), (1.27467, -7.4672), (0.0208, -8.57847), (-1.2023, -10.07169), (-1.93314, -12.81526), (-0.92798, -9.84053), (-0.0288, -8.94808), (0.76426, -10.13791), (0.69774, -7.79773), (0.17254, -4.72617), (-0.38008, -2.62662), (-0.96015, -1.4990796), (-1.18626, -0.93803), (-1.34983, -0.35716), (-1.90352, 0.20553), (-2.84738, 0.75004), (-11.30546, 4.7926996), (-12.39866, 7.30084), (-10.46999, 7.81197), (-5.51945, 6.32607), (-0.81077, 2.23582), (-0.11747, 1.59286), (0.66513, 1.44519), (1.53701, 1.79285), (1.43339, 1.28381), (1.74751, 1.20135), (1.84067, 0.98429), (1.71286, 0.63263), (2.10382, 0.68561), (1.11523, 0.98397), (0.40098, 1.78296), (-0.039, 3.08257), (-0.73426, 12.03212), (-1.05712, 9.23806), (-1.39637, 6.5496), (-1.75204, 3.96671), (-2.72088, 3.43562), (-2.61108, 2.65925), (-2.12798, 1.55121), (-1.27156, 0.11151), (-0.71577, -2.67047), (-0.92003, -7.0483), (-1.17359, -11.87181), (-1.47647, -17.14095), (-0.35538, -4.30598), (-0.35537, -4.30598), (-0.35538, -4.30598), (-0.35537, -4.30598), (1.08275, -1.32136), (1.08275, -1.32136), (1.08275, -1.32135), (1.08275, -1.32136), (4.52729, -5.94524), (3.88825, -5.86137), (2.7206, -4.91553), (1.02434, -3.10766), (-1.29499, -1.9608396), (-4.50208, -1.24978), (-8.63478, -0.6743), (-13.69315, -0.23438), (-16.31927, 0.55561), (-8.90579, 2.3340596), (-2.74989, 4.89221), (2.14841, 8.23002), (1.40761, 4.27198), (0.91051, 5.70982), (0.60854, 9.0428), (0.50171, 14.27089), (0.25914, 12.35546), (-0.0217, 9.89399), (-0.30412, 7.51927), (-0.5882, 5.23128), (-0.70103, 4.05145), (-0.84241, 5.024912), (-0.87787, 5.35891), (-0.80738, 5.05342), (-1.05622, 5.74186), (-1.24368, 4.65463), (-1.57929, 4.02274), (-2.06302, 3.84614), (-1.039, 1.72542), (-1.03899, 1.72542), (-1.039, 1.72543), (-1.03899, 1.72542), (-2.32751, -1.19384), (-2.32751, -1.19384), (-2.3275, -1.19383), (-2.32751, -1.19384), (-13.07909, -6.22351), (-12.17031, -4.7924), (-11.21412, -3.34479), (-10.21053, -1.8807), (-12.2668, -0.90994), (-11.90127, 0.0322), (-9.90909, 0.90452), (-6.29023, 1.70695), (-2.60678, 1.25272), (-1.46792, -0.29409), (-0.93133, -2.55646), (-0.99703, -5.53441), (-0.7332, -2.79335), (-1.38445, -3.99493), (-1.83728, -4.663282), (-2.09172, -4.79844), (-1.30473, -2.84138), (-1.30472, -2.84138), (-1.30473, -2.84138), (-1.30472, -2.84138), (0.0144, -4.375), (0.0144, -4.375), (0.0144, -4.375), (0.0144, -4.375), (0.81349, -16.65105), (2.4558, -13.35507), (4.30422, -10.79546), (6.35877, -8.97221), (2.93939, -4.15273), (1.05005, -3.6169696), (-0.84839, -2.79203), (-2.75594, -1.67794), (-6.7748, -0.65631), (-11.17611, -0.15329), (-11.824653, 0.3222), (-8.7204, 0.77012), (0, 0)}
l = Sequence(Sum[Sequence[Element[L, k], k, 1, K]], K, 1, Length[L])
listey = Sequence((((k / 410 * 2) * π), y(Element[l, k])), k, 1, 410)
N = Length(l)
ordre: 25 - n
Ya0: Sum[y(listey)] / N
Ybk = Sequence((2 / N * Sum[Sequence[(Element[y(listey), j] * sin((((k * j) * 2) * π / N))), j, 1, N]]), k, 1, ordre)
Yak = Sequence((2 / N * Sum[Sequence[(Element[y(listey), j] * cos((((k * j) * 2) * π / N))), j, 1, N]]), k, 1, ordre)
Ythetak = Sequence(arg(Element[Ybk, k] + (ί * Element[Yak, k])), k, 1, ordre)
Ynormk = Sequence(abs(Element[Yak, k] + (ί * Element[Ybk, k])), k, 1, ordre)
t = 2.3387411976724017 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
d = 367.5 (slider from 0 to 500, step 0.05)
listex = Sequence((((k / 410 * 2) * π), x(Element[l, k])), k, 1, 410)
Xbk = Sequence((2 / N * Sum[Sequence[(Element[y(listex), j] * sin((((k * j) * 2) * π / N))), j, 1, N]]), k, 1, ordre)
Xak = Sequence((2 / N * Sum[Sequence[(Element[y(listex), j] * cos((((k * j) * 2) * π / N))), j, 1, N]]), k, 1, ordre)
Xthetak = Sequence(arg(Element[Xak, k] - (ί * Element[Xbk, k])), k, 1, ordre)
Xnormk = Sequence(abs(Element[Xak, k] - (ί * Element[Xbk, k])), k, 1, ordre)
Xa0: Sum[y(listex)] / N
f(x) = Xa0 + Sum[Sequence[(Element[Xnormk, k] * cos((k * x) + Element[Xthetak, k])), k, 1, ordre]]
g(x) = Ya0 + Sum[Sequence[(Element[Ynormk, k] * sin((k * x) + Element[Ythetak, k])), k, 1, ordre]]
α = 2.0943951023931953 rad (slider from 0 to 120°, step 0.5°)
A: (Xa0 + Sum[Sequence[(Element[Xnormk, k] * cos((k * t) + Element[Xthetak, k])), k, 1, ordre]], Xa0 + Sum[Sequence[(Element[Xnormk, k] * sin((k * t) + Element[Xthetak, k])), k, 1, ordre]] + d)
b: x = x(A)
B: (Ya0 - e + Sum[Sequence[(Element[Ynormk, k] * cos((k * t) + Element[Ythetak, k])), k, 1, ordre]], Ya0 + Sum[Sequence[(Element[Ynormk, k] * sin((k * t) + Element[Ythetak, k])), k, 1, ordre]])
c: y = y(B)
liste1 = Sequence((Xa0 + Sum[Sequence[(Element[Xnormk, k] * cos((k * t) + Element[Xthetak, k])), k, 1, or]], Xa0 + Sum[Sequence[(Element[Xnormk, k] * sin((k * t) + Element[Xthetak, k])), k, 1, or]] + d), or, 0, ordre - 1)
liste2 = Sequence((Ya0 - e + Sum[Sequence[(Element[Ynormk, k] * cos((k * t) + Element[Ythetak, k])), k, 1, or]], Ya0 + Sum[Sequence[(Element[Ynormk, k] * sin((k * t) + Element[Ythetak, k])), k, 1, or]]), or, 0, ordre - 1)
liste4 = Sequence(Circle[Element[liste2, k], Element[liste2, k + 1]], k, 1, ordre - 2)
a = CurveCartesian(f(u), g(u), u, t - (2 * α), t + α)
h = CurveCartesian(f(u), g(u), u, 0, (2 * π))
C = Intersect(b, c)
i = false
liste3 = Sequence(Circle[Element[liste1, k], Element[liste1, k + 1]], k, 1, ordre - 1)
k = Circle(Element[liste1, ordre], A)
p = Circle(Element[liste2, ordre], B)
liste5 = Sequence(Segment[Element[liste2, k], Element[liste2, k + 1]], k, 1, ordre - 1)
j = Segment(Element[liste2, ordre], B)
m = Segment(Element[liste1, ordre], A)
liste6 = Sequence(Segment[Element[liste1, k], Element[liste1, k + 1]], k, 1, ordre - 1)
texte1: "N = " + (25 - n) + " paires de cercles"