Drag the Line

Exercises with "Drag the line"
Drag the axis of symmetry, drag the Asymptote, ... You can think of many exercises in which a Line has to be drawn. In next applet a graph of a function of first degree has to be drawn. This is particularly interesting since it focusses on the difference between a line and a linear function. Although graphically they look the same, in GeoGebra they are objects of a different category. We can only compare lines with lines and that's what we will do.[br]Watch in next applet how it works and then try it yourself following the Construction Steps.
Construction Steps
[table][tr][td]1[/td][td][/td][td]Type the command [b]lista = Shuffle[{-2,-1,1,2}][/b] to create a list.[/td][/tr][tr][td]2[/td][td][/td][td]Type the command [b]a = lista(1)[/b] to define a number a.[/td][/tr][tr][td]3[/td][td][/td][td]Type the command [b]b = RandomBetween[-3, 3][/b] to define a number b.[/td][/tr][tr][td]4[/td][td][/td][td]Type the command [b]f(x) = Polynomial[a x + b][/b] to define a function f.[br][u]note 1[/u]: This command prevents the equation to show as e.g. 1x + 2.[br][u]note 2[/u]: Type a space between a and x.[br][/td][/tr][tr][td]5[/td][td][/td][td]Type the command [b]sol = a x + b[/b] to define a line sol.[br]This is the line we will compare with de drawn line.[/td][/tr][tr][td]6[/td][td][/td][td]Type the command [b]A = (-6, -5)[/b] to define a point A.[/td][/tr][tr][td]7[/td][td][/td][td]Type the command [b]B = (-4, -5)[/b] to define a point B.[/td][/tr][tr][td]8[/td][td][/td][td]Type the command [b]ans = Line[A, B][/b] to define a line throug A and B.[br]Rightclick on the two points and the line to define their dynamic colors (see below).[/td][/tr][tr][td]9[/td][td][icon]/images/ggb/toolbar/mode_buttonaction.png[/icon][/td][td]Select the Button Tool with label [b]next exercise[/b] and scripting commands[br][b]UpdateConstruction[][/b] to recalculate the random numbers[br][b]SetValue[A,(-6,-5)][br]SetValue[B,(-4,-5)][/b] to set back the points A and B[br][/td][/tr][tr][td]10[/td][td][icon]/images/ggb/toolbar/mode_text.png[/icon][/td][td]Select the Text Tool and type the dynamix text: [b]Draw the graph of f(x) = f by dragging the red points. When the answer is correct points and line color green.[/b][br]Select f in the list of available objects.[/td][/tr][/table]

Information: Drag the Line