GeoGebra Classroom

# Umbilic torus

## Script version 1

Fx(x,y) = sin(x) * (7 + cos(x/3 - 2*y) + 2 * cos(x/3 + y)) Fy(x,y) = cos(x) * (7 + cos(x/3 - 2*y) + 2 * cos(x/3 + y)) Fz(x,y) = sin(x/3 - 2 * y) + 2 * sin(x/3 + y) g(x) = 1/2 * (sin(x) + 1) t = Slider(0, 2 pi, 0.01, 1, 150, false, true, false, false) a = Surface(Fx(u,v), Fy(u,v), Fz(u,v), u, -pi, pi, v, -pi, pi) n = 60 L_1 = Sequence(-pi + (2 pi)/ n * k, k, 0, n) L_2 = Sequence(-pi + (2 pi)/ n * (k+1), k, 0, n) L_3 = Sequence(Surface(Fx(u, v), Fy(u, v), Fz(u, v), u, -pi, pi, v, Element(L_1, k), Element(L_2, k)), k, 1, n) Execute(Sequence("A"+k+" = Surface(Fx(u, v), Fy(u, v), Fz(u, v), u, Element(L_1, "+k+"), Element(L_2, "+k+"), v, -pi, pi)", k, 1, n)) Execute(Sequence("SetDynamicColor(A"+k+", g("+k+"/n * 2 * pi + t), 0.53, 0.89, 1)", k, 1, n))

## Script version 2

Fx(x,y) = sin(x) * (7 + cos(x/3 - 2*y) + 2 * cos(x/3 + y)) Fy(x,y) = cos(x) * (7 + cos(x/3 - 2*y) + 2 * cos(x/3 + y)) Fz(x,y) = sin(x/3 - 2 * y) + 2 * sin(x/3 + y) g(x) = 1/2 * (sin(x) + 1) t = Slider(0, 2 pi, 0.01, 1, 150, false, true, false, false) a = Surface(Fx(u,v), Fy(u,v), Fz(u,v), u, -pi, pi, v, -pi, pi) n = 60 LK = 0..n L_1 = Zip(-pi + (2 pi)/ n * k, k, LK) L_2 = Zip(-pi + (2 pi)/ n * (k+1), k, LK) #L_3 = Zip(Surface(Fx(u, v), Fy(u, v), Fz(u, v), u, -pi, pi, v, a, b), a, L_1, b, L_2) Execute(Zip("A"+k+" = Surface(Fx(u, v), Fy(u, v), Fz(u, v), u, "+a+", "+b+", v, -pi, pi)", a, L_1, b, L_2, k, 1..n)) #------------------- # Settings #------------------- Execute(Zip("SetDynamicColor(A"+k+", g("+k+"/n * 2 * pi + t), 0.53, 0.89, 1)", k, 1..n)) Execute(Zip("SetLineThickness(A"+k+", 0)", k, 1..n)) Execute(Zip("ShowLabel(A"+k+", false)", k, 1..n)) SetVisibleInView(Fx, -1, false) SetVisibleInView(Fy, -1, false) SetVisibleInView(Fz, -1, false) SetVisibleInView(g, -1, false) SetVisibleInView(g, 1, false) SetVisibleInView(a, -1, false)