Comparing Rates of Change in a Car Race

Comparing Rates of Change in a Car Race
Loading the math board and drawing, please wait…
2023-03-03 11:36
This example demonstrates how to visualize the position of cars in a race using different speed representations. It focuses on the concept of slope as a measure of rate of change in linear relationships. Key mathematical concepts include linear functions, slope comparison, and coordinate geometry. The construction uses GeoGebra commands like RandomUniform, Sequence, and Polygon to create the race track and car models. Suitable for grades 6-8 for algebra and function practice, ideal for classroom activities and online learning resources.

GeoGebra Commands & Parameters

  1. RandomUniform(0, 0.99, 200) → allRandomSeeds, {0.07536995706471185, 0.32824398293471024, 0.5405278112233036, 0.6649148474939078, 0.5006162004100416, 0.7149908206683631, 0.888918252052941, 0.8786544653798103, 0.10978001909606723, 0.6298269886342113, 0.9498566092712807, 0.9279592129695333, 0.6174705258993755, 0.1551642949034372, 0.2957008027515774, 0.05758673623316867, 0.9001759058417332, 0.19903558280325603, 0.7294353040385582, 0.6914133513232606, 0.9701593479656597, 0.8559646729748696, 0.3761454681992267, 0.17980763395486749, 0.02932263874741608, 0.5113984128222984, 0.2576343850162359, 0.9716646786294414, 0.16366187698215062, 0.9045126101951195, 0.4333801691474773, 0.423603190732944, 0.026508621833590058, 0.923881330036718, 0.8721936337858348, 0.07584882750367412, 0.15100525293034534, 0.26236404698933385, 0.559786061134826, 0.28853675021938935, 0.7692067463582213, 0.5416183292026325, 0.007993882608907925, 0.8035620506347639, 0.7168321728520424, 0.9728853970986978, 0.8816316300887643, 0.20569143162605644, 0.19900726682394748, 0.42912425367352064, 0.5088565020597612, 0.1624206440395982, 0.5833455624976838, 0.3441846712064137, 0.5705277623525934, 0.4650211251006965, 0.7724085334088369, 0.647512665621895, 0.1633313939072731, 0.4433659451547565, 0.2079667183935607, 0.9178719518767109, 0.9104141836310834, 0.3044590179054461, 0.5045513745448905, 0.7067424908083919, 0.03193487397797327, 0.5591131547715676, 0.5995426273831705, 0.8914230819498179, 0.12628852066181256, 0.24293143017971278, 0.18148326635593448, 0.3894167855599936, 0.09079771225720888, 0.05664258956095468, 0.647438218642499, 0.189419355316947, 0.59838902182481, 0.09692592292940654, 0.15403791302935002, 0.13015702156358225, 0.46418491411457735, 0.9421315773144102, 0.6553499707037717, 0.20643722711579168, 0.823041357000883, 0.2177619364693272, 0.963916588739453, 0.38207637628196206, 0.035847723816624905, 0.6242259188186552, 0.21917631131623364, 0.24186111993750073, 0.16888120411406188, 0.8642122064813994, 0.52005675455585, 0.6393754614789219, 0.31666907278532364, 0.2190485605325656, 0.6157810630287772, 0.8243928931450714, 0.17466271074517734, 0.8126237248647271, 0.5908742198177606, 0.022583999788699814, 0.9135632709365417, 0.2378447781637362, 0.33698573375064605, 0.6115315313389861, 0.24236463414097356, 0.5141865441726815, 0.9754645605616517, 0.590471667910253, 0.9120907873772066, 0.4756617439715817, 0.37062664701241566, 0.5267961101208722, 0.6768042258775492, 0.506498713368133, 0.5543500128506502, 0.9301518450200118, 0.932749501505285, 0.37696097390219485, 0.4380127628160008, 0.33496607463587275, 0.5304705981178562, 0.8840759756154087, 0.9078572364218642, 0.49440141859885084, 0.8684025848163209, 0.3615624346390591, 0.3146203386934635, 0.8231115423689915, 0.7297878958846665, 0.9499546707376534, 0.5177126311927898, 0.7527202903779816, 0.4378047853926212, 0.8818182829735262, 0.8083600827093506, 0.2526877468129239, 0.43651963610892097, 0.3980361853912613, 0.48494053565826073, 0.3601539337535182, 0.03768754829359946, 0.18941502495523055, 0.20725291114596148, 0.7254666654060017, 0.5855247960374899, 0.6533212681927846, 0.3746504807699598, 0.6054024019639545, 0.6133639103269122, 0.9477023991497175, 0.07585027977748975, 0.7535792771349589, 0.07757696012773511, 0.294683091303444, 0.6657994848006024, 0.027239352286472774, 0.5253144359153514, 0.43294736577934273, 0.8672348252926271, 0.0714421201675007, 0.053457071132529455, 0.5123268815096389, 0.8115151866049974, 0.8957643601530497, 0.5067147268550152, 0.6954118084937855, 0.7349375586863393, 0.40484135149891726, 0.24303116088779542, 0.16958514245000209, 0.9730658986690702, 0.012512169579103383, 0.33436588332083994, 0.058652175648664984, 0.28660720703498044, 0.019947809328005366, 0.3405235106172481, 0.8761964754292657, 0.8880634142394255, 0.8809419989080765, 0.7829883382738959, 0.842939660462526, 0.42876796760368263, 0.9125367005827982, 0.7946965793860303, 0.15771667379396972, 0.47098456878771006, 0.3963306589058199, 0.9203404500026036, 0.1361993165804028, 0.49950136658915695, 0.22518499387510751, 0.6201484529369897, 0.553210415481495}
  2. Sequence(xMin + px16 + (n * (boxWidth + px16)), n, 0, 4) → xStarts, {-1.7447999999999997, 8.1189, 17.982599999999998, 27.8463, 37.71}
  3. makeBox((xStarts(1), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2)))) → car1Box
  4. Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1) → currentRandomSeeds
  5. If(randomSpeed ≟ 1, "fastest", "slowest") → textRandomSpeed
  6. Sequence((A * 5), A, 4, 12) → possibleRates, {20, 25, 30, 35, 40, 45, 50, 55, 60}
  7. Element(possibleRates, 1 + floor((currentRandomSeeds(1) * Length[possibleRates]))) → randomRate1
  8. Element(Remove[possibleRates, {randomRate1}], 1 + floor((currentRandomSeeds(2) * (Length[possibleRates] - 1)))) → randomRate2
  9. Element(Remove[possibleRates, {randomRate1, randomRate2}], 1 + floor((currentRandomSeeds(3) * (Length[possibleRates] - 2)))) → randomRate3
  10. Element(Remove[possibleRates, {randomRate1, randomRate2, randomRate3}], 1 + floor((currentRandomSeeds(4) * (Length[possibleRates] - 3)))) → randomRate4
  11. IndexOf(Max[{randomRate1, randomRate2, randomRate3, randomRate4}], {randomRate1, randomRate2, randomRate3, randomRate4}) → maxIndex
  12. IndexOf(Min[{randomRate1, randomRate2, randomRate3, randomRate4}], {randomRate1, randomRate2, randomRate3, randomRate4}) → minIndex
  13. If(randomSpeed ≟ 1, maxIndex, minIndex) → correctIndex
  14. Corner(5) → layoutAppSize
  15. Polygon({(-4.5, 105), (5.9, 105), (5.9, -10), (-4.5, -10)}) → graphArea
  16. VerticalText("Miles") → labelY
  17. Segment((0, 00), (0, 105)) → yAxisSeg
  18. Segment((0, 0), (5.9, 0)) → xAxisSeg
  19. Zip(n + "\vphantom{|}&" + (m) + "\vphantom{|}\\\hline", n, randomPointsX2, m, randomPointsY2) → textTable2List
  20. Corner(labelX, 1) → PointBottomCases
  21. Polygon({(xTrackStart, yTrackStart), (xTrackStart, yTrackEnd), (xTrackEnd, yTrackEnd), (xTrackEnd, yTrackStart)}) → trackPolygon
  22. Sequence(Segment[(xTrackStart, yTrackEnd + (n * (yTrackStart - yTrackEnd) / 4)), (xTrackEnd, yTrackEnd + (n * (yTrackStart - yTrackEnd) / 4))], n, 1, 3) → trackLines
  23. Sequence((xTrackStart + 1, yTrackStart - (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4) → carStart
  24. Sequence((xTrackEnd + 3, yTrackEnd + (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4) → carEndOriginal
  25. Zip(A + ((750 / 800 * (xMax - xMin)), 0), A, carStart) → carEnd
  26. Zip(A + (Min[1, (animationSlider * R / Min[randomRates])] * (B - A)), A, carStart, B, carEnd, R, randomRates) → movingPoints
  27. Sequence((xTrackEnd - 10, yTrackStart - (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4) → carRibbonPoints
  28. Sequence(Sequence[Polygon[{(xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) + k) * finishBoxHeight)), (xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) + 1 + k) * finishBoxHeight)), (xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) + 1 + k) * finishBoxHeight)), (xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) + k) * finishBoxHeight))}], n, 0, 7], k, 0, 1) → finishLineBlack, {{3.5582092503764216, 3.558209250375967, 3.558209250375967, 3.5582092503764216, 3.558209250375512, 3.5582092503764216, 3.558209250375512, 3.558209250377331}, {3.558209250375967, 3.558209250375967, 3.558209250375967, 3.5582092503764216, 3.5582092503764216, 3.5582092503764216, 3.5582092503764216, 3.5582092503764216}}
  29. Sequence(Sequence[Polygon[{(xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) - k + 1) * finishBoxHeight)), (xTrackEnd - ((k + 2) * finishBoxWidth), yTrackStart - (((2 * n) + 2 - k) * finishBoxHeight)), (xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) + 2 - k) * finishBoxHeight)), (xTrackEnd - ((k + 1) * finishBoxWidth), yTrackStart - (((2 * n) - k + 1) * finishBoxHeight))}], n, 0, 7], k, 0, 1) → finishLineWhite, {{3.5582092503764216, 3.5582092503764216, 3.5582092503768763, 3.5582092503768763, 3.5582092503764216, 3.5582092503764216, 3.5582092503764216, 3.558209250375512}, {3.5582092503764216, 3.5582092503764216, 3.5582092503768763, 3.558209250375967, 3.5582092503764216, 3.558209250375512, 3.558209250377331, 3.558209250375512}}
  30. Sort(randomRates) → randomRatesSorted
  31. Zip(IndexOf[n, randomRatesSorted], n, randomRates) → indexPlace
  32. Corner(textSize, 4) → PointSizeA_{start}
  33. Vector(PointSizeA_{start}, PointSizeA) → pointSizeA
  34. makeBox((xStarts(2), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2)))) → car2Box
  35. makeBox((xStarts(3), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2)))) → car3Box
  36. makeBox((xStarts(4), dimensions(4) - (56 * pixelsH)), boxWidth, (boxRatio * (dimensions(4) - dimensions(2)))) → car4Box
  37. Element({"Car A", "Car B", "Car C", "Car D"}, correctIndex) → correctCar
  38. Sequence((xTrackEnd - 5.8, yTrackStart - (((2 * n) - 1) * (yTrackStart - yTrackEnd) / 8)), n, 1, 4) → CarSpeedPoints
  39. If(randomSpeed ≟ 1, minIndex, maxIndex) → incorrectIndex
  40. Sequence(Text[n, (n - 0.175, -2.5), true, true], n, 0, 5) → xNums
  41. Zip(Vector[Midpoint[CarPointA, CarPointC], n], n, movingPoints) → vectorCars
  42. Translate(carAGreen, vectorCars(1)) → carAMoving
  43. Translate(carCPurple, vectorCars(3)) → carCMoving
  44. Translate(carDOrange, vectorCars(4)) → carDMoving
  45. Translate(carBRed, vectorCars(2)) → carBMoving
  46. Sequence(Segment[(n, 0), (n, -1.5)], n, 0, 5) → xAxisSegs
  47. Sequence(Text[(20 * n), ((-If[n < 5, 1.1, 1.3]), (20 * n) + 4), true, true], n, 1, 5) → yNums
  48. If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 1, "#008475", selectedIndex ≟ 1, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 1, "#B00020", selectedIndex ≟ 1, "#6557D2", "#252525") → car1Color
  49. If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 2, "#008475", selectedIndex ≟ 2, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 2, "#B00020", selectedIndex ≟ 2, "#6557D2", "#252525") → car2Color
  50. If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 3, "#008475", selectedIndex ≟ 3, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 3, "#B00020", selectedIndex ≟ 3, "#6557D2", "#252525") → car3Color
  51. If(showanswer ∨ showsolution ∨ validate ∧ correct, If[correctIndex ≟ 4, "#008475", selectedIndex ≟ 4, "#B00020", "#252525"], validate ∧ selectedIndex ≟ 4, "#B00020", selectedIndex ≟ 4, "#6557D2", "#252525") → car4Color
  52. PolyLine({(xTrackEnd, yTrackStart), (xTrackStart, yTrackStart), (xTrackStart, yTrackEnd), (xTrackEnd, yTrackEnd)}) → trackBorder
  53. Zip(Vertex[n, 3], n, {car1Box, car2Box, car3Box, car4Box}) → PointsValidation
  54. Vector(FeedbackB, PointsValidation(correctIndex)) → correctVect
  55. Vector(FeedbackB, PointsValidation(selectedIndex)) → incorrectVect
  56. Translate(picCheck, correctVect) → correctPic
  57. Translate(picCross, incorrectVect) → incorrectPic
  58. Polygon({(xTrackEnd - (1 * finishBoxWidth), yTrackEnd), (xTrackEnd - (3 * finishBoxWidth), yTrackEnd), (xTrackEnd - (3 * finishBoxWidth), yTrackStart), (xTrackEnd - (1 * finishBoxWidth), yTrackStart)}) → finishOutline
  59. Sequence(Segment[(0, (10 * n)), (-0.1, (10 * n))], n, 0, 9) → yAxisSegs
  60. Sequence(x = xMin + (n * abs(xMax - xMin) / 4), n, 1, 4) → linesAlignment

AI Drawing Prompt Reference

Draw a car race scene showing four cars moving along a straight track to compare their speeds (rates of change). The graphic includes a coordinate plane with time (0-5) on the x-axis and distance (0-100) on the y-axis. A rectangular track area is shown with horizontal dividing lines. Four cars, colored green, red, purple, and orange, are represented as rectangles starting from the left and moving rightward at different random speeds. A checkered flag pattern appears at the finish line on the right. The image includes axis labels, tick marks, and a slider to control animation progress, displaying each car's current speed value.
The prompt above was compiled from the original drawing commands and is for reference only.