Google Classroom
GeoGebraGeoGebra Klaslokaal

Torus: Void

Script

#--------------------------------------- # Initial parameters and functions #--------------------------------------- speed = 1 a = Slider(0, 2pi, 0.01, speed, 170, false, true, false, false) R = 10 r = 4 fx(x, y) = (R+r cos(x)) *cos(y) fy(x, y) = (R+r cos(x)) *sin(y) fz(x, y) = r sin(x) g(x) = 10+cos(x - pi/2) #------------------------------ # Rings #------------------------------ #c = Curve( fx(a, t) , fy(a, t) , fz(a, t), t, 0, 2pi) n = 23 Ln = Zip( 2 * pi / n * k, k, 1..n ) Lname = Zip( "C"+Text(k), k, 1..n) Execute(Zip( name +" = Rotate( Curve( fx(a + "+k+", t) , fy(a + "+k+", t) , fz(a + "+k+", t), t, 0, 2pi), 0.25, yAxis )", k, Ln, name, Lname)) #------------------------------ # Settings #------------------------------ Execute(Zip("ShowLabel("+name+", false)", name, Lname)) Execute(Zip("SetLineThickness("+name+", 3)", name, Lname)) Execute(Zip("SetVisibleInView("+name+", 1, false)", name, Lname)) SetActiveView(-1) SetBackgroundColor( "Black" ) ShowAxes(3, false) ShowGrid(3, false) StartAnimation(a, true) #----------------------------------------------------------- # Finally add this script to slider "a" in update tab # Execute(Zip("SetDynamicColor("+name+", Max(g("+(k+a)+"), 10), Max(g("+(k+a)+"), 10), Max(g("+(k+a)+"), 10))", k, Ln, name, Lname)) #-----------------------------------------------------------