N=%v

nnodes = 2 (slider from 1 to 10, step 1)
A_{10} = Point(c)
B_{10} = If(nnodes ≥ 10, A_{10}, (0, 0))
A_9 = Point(c)
B_9 = If(nnodes ≥ 9, A_9, (0, 0))
A_8 = Point(c)
B_8 = If(nnodes ≥ 8, A_8, (0, 0))
A_7 = Point(c)
B_7 = If(nnodes ≥ 7, A_7, (0, 0))
A_6 = Point(c)
B_6 = If(nnodes ≥ 6, A_6, (0, 0))
A_5 = Point(c)
B_5 = If(nnodes ≥ 5, A_5, (0, 0))
A_4 = Point(c)
B_4 = If(nnodes ≥ 4, A_4, (0, 0))
A_3 = Point(c)
B_3 = If(nnodes ≥ 3, A_3, (0, 0))
A_2 = Point(c)
B_2 = If(nnodes ≥ 2, A_2, (0, 0))
C, H = Intersect(c, xAxis)
B = Intersect(xAxis, yAxis)
A_1 = Point(c)
B_1 = If(nnodes ≥ 1, A_1, (0, 0))
z: Sum[{B_1, B_2, B_3, B_4, B_5, B_6, B_7, B_8, B_9, B_{10}}] / nnodes
I = Point(z)
α = Angle(C, B, I)
theta: α + 0
xz: x(z)
yz: y(z)
D = (-1.1, -1.1)
E: D + (2.2, 0)
F: D + (0, (-5))
G: D + (2.2, (-5))
absyA: abs(y(A_1))
signyA = If(y(A_1)  <  0, 1, 2)
poly2, d_1, e_1, g_1, f_1 = Polygon(D, E, G, F)
r: abs(z)
text1: "$ r=" + (LaTeX[r]) + " $"
text3: "$ \psi=" + (LaTeX[theta]) + " $"
text2: "$z=\frac{1}{N}\sum_{j=1}^Ne^{\theta_j}=re^{i\psi}=" + (LaTeX[r]) + "e^{i" + (LaTeX[theta]) + "}$"
xmin = -1.350368148148148
xmax = 1.3933355555555529
ymin = -1.517777777777775
ymax = 1.1548148148148145
UR = Corner(3)
LL = Corner(1)