Google Classroom
GeoGebraGeoGebra Classroom

Flowers

GGB Script

#===================================== # Button 1 #===================================== a = Slider(0, 3, 0.01, 1, 160, false, true, false, false) b = Slider(0, 3, 0.01, 1, 160, false, true, false, false) p = Slider(1, 10, 1, 1, 160, false, true, false, false) q = Slider(1, 10, 1, 1, 160, false, true, false, false) f(x) = a * cos( p/q * x ) + b g(x) = sqrt(x)/3 N = 100 M = Slider(1, N, 1, 1, 160, false, true, false, false) SetValue(M, N) Lm = 1..M # Create list with names Lname = Zip("flower"+k, k, Lm) Execute(Zip(name" = Curve("+k+"/100 f(t) cos(t), "+k+"/100 f(t) sin(t), "+k+"/100 g(f(t)), t, 0, q * 2π) ", name, Lname, k, Lm)) stick = Segment((0,0,0), (0,0,-4)) #===================================== # Button 2 #===================================== red = random() green = random() Execute(Zip("SetDynamicColor("+name+", red, green, "+k+"/100)", name, Lname, k, Lm)) Execute(Zip("ShowLabel("+name+", false)", name, Lname)) Execute(Zip("SetLineThickness("+name+", 5)", name, Lname)) #===================================== # Button 3 #===================================== SetValue(a, RandomUniform( 0, 3 )) SetValue(b, RandomUniform( 0.5, 3 )) SetValue(p, RandomBetween(1, 10)) SetValue(q, RandomBetween(1, 10)) UpdateConstruction()