Graphing Changes on the Number Line

Graphing Changes on the Number Line
Loading the math board and drawing, please wait…
2026-01-05 23:43
This example demonstrates how to graph changes on the number line, showing how points move on the number line. The core math concepts involved include integer addition and subtraction, and the movement of points on the number line. The construction involves using GeoGebra's Sequence, Element, Textfield, and other commands and objects. This example is suitable for middle school math education, part

GeoGebra Commands & Parameters

  1. Sequence(Random[1, 10], i, 1, 10) → randomNumbers, {5, 8, 10, 3, 10, 9, 1, 6, 1, 3}
  2. Element(randomNumbers, Mod[questionCount, Length[randomNumbers]] + 1) → randomNumber
  3. Textfield(input) → inputBox
  4. Join({Sequence[Segment[Corner[4] + (RasterPixMat * ((k * RasterStepXY), 0)), Corner[4] + (RasterPixMat * ((k * RasterStepXY), RasterMaxY))], k, 0, RasterMaxX / RasterStepXY], Sequence[Segment[Corner[4] + (RasterPixMat * (0, (k * RasterStepXY))), Corner[4] + (RasterPixMat * (RasterMaxX, (k * RasterStepXY)))], k, 0, RasterMaxY / RasterStepXY]}) → RasterStrecken
  5. Join({Sequence[Text[UnicodeToLetter[65 + k], Midpoint[Corner[4] + (RasterPixMat * ((k * RasterStepXY), RasterMaxY)), Corner[4] + (RasterPixMat * (((k + 1) * RasterStepXY), RasterMaxY))], false, true, 0, -1], k, 0, RasterMaxX / RasterStepXY - 1], Sequence[Text[("" * k), Midpoint[Corner[4] + (RasterPixMat * (RasterMaxX, ((k - 1) * RasterStepXY))), Corner[4] + (RasterPixMat * (RasterMaxX, (k * RasterStepXY)))], false, true, 1, 0], k, 1, RasterMaxY / RasterStepXY]}) → RasterBeschriftung
  6. Sequence(Sequence[Corner[4] + (RasterPixMat * ((k * RasterStepXY), (m * RasterStepXY))), k, 0, RasterMaxX / RasterStepXY], m, 0, RasterMaxY / RasterStepXY) → RasterPunkte
  7. Ellipse(Midpoint[PointsAZK(1), PointsAZK(2)] + (sqrt(Distance[PointsAZK(2), Midpoint[PointsAZK(1), PointsAZK(2)]]^(2) - Distance[PointsBZK(2), Midpoint[PointsAZK(1), PointsAZK(2)]]^(2)), 0), Midpoint[PointsAZK(1), PointsAZK(2)] + ((-sqrt(Distance[PointsAZK(2), Midpoint[PointsAZK(1), PointsAZK(2)]]^(2) - Distance[PointsBZK(2), Midpoint[PointsAZK(1), PointsAZK(2)]]^(2))), 0), Distance[PointsAZK(1), PointsAZK(2)] / 2) → ellZK
  8. If(step < 5, -7, 3) → numberStone1
  9. If(step < 5, 10, -8) → numberStone2
  10. If(step < 5, -5, 2) → numberStone3
  11. If(step < 5, -8, -6) → numberStone4
  12. If(step < 5, 3, 7) → numberStone5
  13. If(step < 5, 5, -2) → numberStone6
  14. Sequence(IsInRegion[AllPStones(k), RegionZK(1)], k, 1, Length[AllPStones]) → StoneInRegion
  15. Sum(Sequence[If[StoneInRegion(k), AllNumbersStones(k), 0], k, 1, Length[AllNumbersStones]]) → actualTemperature
  16. Sequence(PointsThermoEnd(1) + (k * (0, Distance[PointsThermoEnd(1), PointsThermoEnd(2)] / (thermoEnd - thermoStart))), k, 0, thermoEnd - thermoStart, 1) → PointsThermo
  17. RemoveUndefined(Sequence[If[Mod[TemperatureList(k), thermoStepMark] ≟ 0, Segment[PointsThermo(k) + (((-segLengthThermo)) / 2, 0), PointsThermo(k) + (segLengthThermo / 2, 0)]], k, 1, Length[PointsThermo]]) → segMarkThermo
  18. RemoveUndefined(Sequence[If[Mod[TemperatureList(k), thermoStepCap] ≟ 0, Text[((("\textsf{\(" * If[TemperatureList(k) > 0, "+", ""]) * TemperatureList(k)) * "\)}"), PointsThermo(k) + ((6 / 5 * segLengthThermo), 0.05), false, true, 0, 0]], k, 1, Length[PointsThermo]]) → CapThermo
  19. Text(((("\textsf{\bold{\(" * If[actualTemperature > 0, "+", ""]) * actualTemperature) * "\)}}"), PointsThermo(IndexOf[actualTemperature, TemperatureList]) + ((-6 / 5 * segLengthThermo), 0.05), false, true, 0, 0) → CapActualTemperature
  20. Sequence(((dimStoneA * cos(k°)), (dimStoneB * sin(k°))), k, 0, 360, 5) → PointStone
  21. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone1 > 0, "+", numberStone1 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone1)), (abs(numberStone1) * "")]) * "}}}"), PStone1 + (0, 0.05), false, true, 0, 0) → txtStone1
  22. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone2 > 0, "+", numberStone2 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone2)), (abs(numberStone2) * "")]) * "}}}"), PStone2 + (0, 0.05), false, true, 0, 0) → txtStone2
  23. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone3 > 0, "+", numberStone3 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone3)), (abs(numberStone3) * "")]) * "}}}"), PStone3 + (0, 0.05), false, true, 0, 0) → txtStone3
  24. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone4 > 0, "+", numberStone4 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone4)), (abs(numberStone4) * "")]) * "}}}"), PStone4 + (0, 0.05), false, true, 0, 0) → txtStone4
  25. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone5 > 0, "+", numberStone5 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone5)), (abs(numberStone5) * "")]) * "}}}"), PStone5 + (0, 0.05), false, true, 0, 0) → txtStone5
  26. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone6 > 0, "+", numberStone6 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone6)), (abs(numberStone6) * "")]) * "}}}"), PStone6 + (0, 0.05), false, true, 0, 0) → txtStone6
  27. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[numberStone7 > 0, "+", numberStone7 ≟ 0, "\phantom{+}", "\(-\)"] * abs(numberStone7)), (abs(numberStone7) * "")]) * "}}}"), PStone7 + (0, 0.05), false, true, 0, 0) → txtStone7
  28. Textfield(input021) → InputBox021
  29. Textfield(input031) → InputBox031
  30. Textfield(input041) → InputBox041
  31. Textfield(input051) → InputBox051
  32. Textfield(input061) → InputBox061
  33. Textfield(input071) → InputBox071
  34. SelectedIndex(dropdown031) → index031
  35. If(actualTemperature > -2, index031 ≟ 2, index031 ≟ 3) → correctdd031
  36. SelectedIndex(dropdown061) → index061
  37. If(actualTemperature > -4, index061 ≟ 2, index061 ≟ 3) → correctdd061
  38. SelectedIndex(dropdown081) → index081
  39. SelectedIndex(dropdown082) → index082
  40. Segment(ZGStart + ((-ZGEdge), 0), ZGStart + (ZGLength + ZGEdge, 0)) → ZGSeg
  41. Sequence(ZGStart + (k / (ZGMax - ZGMin) * (ZGLength, 0)), k, 0, ZGMax - ZGMin) → ZGPoints
  42. Sequence(Segment[ZGPoints(k) + (0, If[Mod[k, ZGCap] ≟ 1, ZGDis02, ZGDis01]), ZGPoints(k) - (0, If[Mod[k, ZGCap] ≟ 1, ZGDis02, ZGDis01])], k, 1, ZGMax - ZGMin + 1) → ZGSegList
  43. Sequence(Text[(("\textsf{\small{\bold{\(" * (ZGMin + k - 1)) * "\)}}}"), ZGPoints(k) + (If[ZGMin + k - 1 < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1], k, 1, ZGMax - ZGMin + 1, ZGCap) → ZGCapList
  44. Text("\textsf{\textcolor{db6114}{\small{\bold{\(-2\)}}}}", ZGPoints(ZGMin - 2 - 1) + (If[ZGMin - 2 - 1 < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1) → CapZG02
  45. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[number031 > 0, "+", number031 ≟ 0, "\phantom{+}", "\(-\)"] * abs(number031)), (abs(number031) * "")]) * "}}}"), Pos031 + (0, 0.05), false, true, 0, 0) → txtStone031
  46. Segment(PosZG02 + (0, ZGDis02 + 0.25), PosZG04 + (0, ZGDis02 + 0.25)) → seg03
  47. Text((((("\textsf{\textcolor{db6114}{\small{\bold{\(" * If[actualTemperature < -2, "-", "+"]) * "\) ") * abs(number031)) * "}}}}"), Midpoint[seg03], false, true, 0, 1) → CapZG03
  48. Text((("\textsf{\textcolor{db6114}{\small{\bold{\(" * actualTemperature) * "\)}}}}"), ZGPoints(ZGMin + actualTemperature - 1) + (If[actualTemperature < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1) → CapZG04
  49. Segment(ZGStart081 + ((-ZGEdge), 0), ZGStart081 + (ZGLength08 + ZGEdge, 0)) → ZGSeg081
  50. Segment(ZGStart082 + ((-ZGEdge), 0), ZGStart082 + (ZGLength08 + ZGEdge, 0)) → ZGSeg082
  51. Sequence(ZGStart081 + (k / (ZGMax - ZGMin) * (ZGLength08, 0)), k, 0, ZGMax - ZGMin) → ZGPoints081
  52. Sequence(ZGStart082 + (k / (ZGMax - ZGMin) * (ZGLength08, 0)), k, 0, ZGMax - ZGMin) → ZGPoints082
  53. Sequence(Segment[ZGPoints081(k) + (0, If[Mod[k, ZGCap] ≟ 1, ZGDis02, ZGDis01]), ZGPoints081(k) - (0, If[Mod[k, ZGCap] ≟ 1, ZGDis02, ZGDis01])], k, 1, ZGMax - ZGMin + 1) → ZGSegList081
  54. Sequence(Segment[ZGPoints082(k) + (0, If[Mod[k, ZGCap] ≟ 1, ZGDis02, ZGDis01]), ZGPoints082(k) - (0, If[Mod[k, ZGCap] ≟ 1, ZGDis02, ZGDis01])], k, 1, ZGMax - ZGMin + 1) → ZGSegList082
  55. Sequence(Text[(("\textsf{\small{\bold{\(" * (ZGMin + k - 1)) * "\)}}}"), ZGPoints081(k) + (If[ZGMin + k - 1 < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1], k, 1, ZGMax - ZGMin + 1, ZGCap) → ZGCapList081
  56. Sequence(Text[(("\textsf{\small{\bold{\(" * (ZGMin + k - 1)) * "\)}}}"), ZGPoints082(k) + (If[ZGMin + k - 1 < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1], k, 1, ZGMax - ZGMin + 1, ZGCap) → ZGCapList082
  57. If(step ≟ 2, correct021, step ≟ 7, correct071, true, step ≟ 3, correct031 ∧ correctdd031, step ≟ 4, correct041, step ≟ 5, correct051, step ≟ 6, correct061 ∧ correctdd061) → clickableBtnNext
  58. Text((("\textsf{\bold{\textcolor{white}{" * If[showMinusStone, (If[number061 > 0, "+", number061 ≟ 0, "\phantom{+}", "\(-\)"] * abs(number061)), (abs(number061) * "")]) * "}}}"), Pos061 + (0, 0.05), false, true, 0, 0) → txtStone061
  59. Segment(PosZG05 + (0, ZGDis02 + 0.25), PosZG07 + (0, ZGDis02 + 0.25)) → seg06
  60. Text((((("\textsf{\textcolor{db6114}{\small{\bold{\(" * If[actualTemperature < -4, "-", "+"]) * "\) ") * abs(number061)) * "}}}}"), Midpoint[seg06], false, true, 0, 1) → CapZG06
  61. Text((("\textsf{\textcolor{db6114}{\small{\bold{\(" * actualTemperature) * "\)}}}}"), ZGPoints(ZGMin + actualTemperature - 1) + (If[actualTemperature < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1) → CapZG07
  62. Segment(PosZG081(1) + (0, ZGDis02 + 0.25), PosZG081(2) + (0, ZGDis02 + 0.25)) → seg081
  63. Segment(PosZG082(1) + (0, ZGDis02 + 0.25), PosZG082(2) + (0, ZGDis02 + 0.25)) → seg082
  64. Text("\textsf{\textcolor{db6114}{\small{\bold{\(-3\)}}}}", ZGPoints(ZGMin - 3 - 1) + (If[-4 < 0, -0.15, 0], (-ZGDis02)), false, true, 0, -1) → CapZG05
  65. If(step ≟ 2 ∨ step ≟ 5, (4.75, 8.25), step ≟ 3 ∨ step ≟ 6, (2, 6.25), step ≟ 4 ∨ step ≟ 7, (2, 4), (1, 1)) → PosBtnShowSolution