#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

Empty all input boxes

$b=$

Reset app

\textsf{Rate of change is the ratio of}\\textsf{differences in }y\textendash\textsf{values to }\x\textendash\textsf{values.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{}

#eeeeee

#2E006758

#2EB00020

\text{Drag to start}

$\textsf{Rate of change =}\vphantom{b}$

\text{Describe the applet here}

$\text{Some string input}$

\text{What is the rate of change for\the given line? } 

1 = arrow left, 2 = arrow right, 3 = arrow uo, 4 = arrow down

numRandoms = 3
allRandomSeeds = RandomUniform(0, 0.99, 200)
ranSLP_{1}: {0.2, 0.25, 1 / 3, 0.4, 0.5, 0.6, 2 / 3, 0.75, 0.8, 1, 1.25, 4 / 3, 1.5, 5 / 3, 2, 2.5, 3, 4, 5}
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randomNum1: 1 + floor((currentRandomSeeds(1) * Length[ranSLP_{1}]))
example_{1}: countQuestion
slp = Element(ranSLP_{1}, randomNum1)
xCoordsPossible_{1} = KeepIf(IsInteger[(kk * slp)] ∧ (kk * slp) ≤ 15, kk, Sequence[0, 15, 1])
xCoords_{1} = Sample(xCoordsPossible_{1}, Min[5, Length[xCoordsPossible_{1}]])
lineToShow_{1} = Ray((0, 0), (1, slp))
Points_{1} = Zip((xx, lineToShow_{1}(xx)), xx, Sort[xCoords_{1}])
P3: Points_{1}(3)
P2: Points_{1}(2)
PointToUse = If(slp ≥ 1, P2, P3)
P1: Points_{1}(1)
DeltaXnum_{1}: x(PointToUse) - x(P1)
HintPoint: (x(PointToUse), y(P1))
mult: 1 + floor((currentRandomSeeds(3) * 10))
canBeSimplified: DeltaXnum_{1} ≟ 1 ∨ DeltaXnum_{1} ≠ Denominator[(slp * mult)]
text2 = Text(((y(PointToUse) - y(P1)) * mult), Midpoint[PointToUse, HintPoint], true, true, 1, 0)
text1 = Text(x(PointToUse) - x(P1), Midpoint[P1, HintPoint], true, true, 0, -1)
inputA = NaN
inputSaved: {"", "", ""}
inputDefined: Sum[Zip[A ≠ "?" ∧ ReplaceAll[A, " ", ""] ≠ "", A, {stringA}]] ≟ 1
validA = true
validB = true
validC = true
inputCurrent: {stringA, stringB, stringC}
inputValid: Sum[{validA}] ≟ 1
inputB = NaN
onboarding = false
randomNum2: randomNum1 + 2 + floor((currentRandomSeeds(2) * 10))
correct1: inputA ≟ randomNum1
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
textSolution: "\textsf{\bold{Possible Solution}}\\
\textsf{Rate of change}=\frac{" + (LaTeX[text2]) + "}{" + (LaTeX[text1]) + "}" + (LaTeX[If[canBeSimplified, ("=" * FractionText[(slp * mult)]), ""]]) + ""
InputBoxB = Textfield(inputB)
correct2: inputB ≟ randomNum2
correct: inputA ≟ (slp * mult)
showbuttons = true
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
borderBox = Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], A], A, {(pixelsLeft, pixelsTop), (pixelsLeft, y(Corner[5]) - pixelsBottom), Corner[5] - (pixelsRight, pixelsBottom), (x(Corner[5]) - pixelsRight, pixelsTop)}])
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + ""
layoutY: 178
layoutX: 16
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputDefined ∧ inputValid
pulsingSpeed: 8
pulsing = 0.6 (slider from 0 to 1, step 0.1)
onboardingCase: 1
onboardingX: 337
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
solutionView: showanswer ∨ showsolution
InputBoxA = Textfield(inputA)
altFeedback: "\text{" + (LaTeX[If[correct, (("Your answer is correct. Total number correct: " * countCorrect) * ". "), ("Your answer is not correct. " * If[tries < 3, "Try again. ", "Maybe next time. "])]]) + "}" + (LaTeX[If[showsolution, ("\\" * textSolution), If[showhint ∨ showhinttypicalerror, textHint, ""]]]) + ""
InputBoxC = Textfield(inputC)
textFeedback: "\text{\vphantom{✕}" + (LaTeX[If[correct, (("\textcolor{" * colorTealSuccess) * "}{✓ Correct}"), (((("\textcolor{" * colorRedError) * "}{✕ ") * If[tries < 3, "Try again", "Maybe next time"]) * "}")]]) + "}"
maxTries: 3
labelBtnValidate: "\text{CHECK (" + (LaTeX[maxTries - tries]) + ")}"
enableInput: tries < maxTries ∧ (¬(validate ∧ correct))
countClicks_{1} = 0
selectedPoints_{1}: {}
AppSize_{1} = Corner(5)
MoveGuideLine_{1} = (4.286574365588202, 0.007914436152141742)
ViewCorner1_{1}: (-1, -1)
ViewCorner3_{1}: (15.5, 15.5)
q1_{1} = Polygon({ViewCorner1_{1}, (x(ViewCorner3_{1}), y(ViewCorner1_{1})), ViewCorner3_{1}, (x(ViewCorner1_{1}), y(ViewCorner3_{1}))})
Cor1 = (-13.853898949218006, -2.588456143043945)
Cor3 = (17.02350243768618, 16.619047569751473)
P4: Points_{1}(4)
P5: Points_{1}(5)
colorSelected_{1}: {224, 116, 21} / 255
colorUnselected_{1}: {218, 37, 112} / 255
PointsLabels_{1} = Zip((((("\left(" * FractionText[x(PP)]) * ",") * FractionText[(y(PP) * mult)]) * "\right)"), PP, Points_{1})
num_{1} = 4
animation_{1} = 0 (slider from 0 to 2)
horizVec_{1}: (Vector[(x(Points_{1}(selectedPoints_{1}(2))), y(Points_{1}(selectedPoints_{1}(1)))), Points_{1}(selectedPoints_{1}(1))] * Max[0, animation_{1} - 1])
vertVec_{1}: (Vector[Points_{1}(selectedPoints_{1}(2)), (x(Points_{1}(selectedPoints_{1}(2))), y(Points_{1}(selectedPoints_{1}(1))))] * Min[1, animation_{1}])
speed_{1}: 2
label1_{1}: PointsLabels_{1}(1)
label2_{1}: PointsLabels_{1}(2)
label3_{1}: PointsLabels_{1}(3)
label4_{1}: PointsLabels_{1}(4)
label5_{1}: "" + (LaTeX[PointsLabels_{1}(5)]) + ""
colorSelected2_{1}: {189, 108, 67} / 256
xAxisFake_{1} = Segment((0, 0), (x(ViewCorner3_{1} - 0.05), 0))
yAxisFake_{1} = Segment((0, 0), (0, x(ViewCorner3_{1} - 0.05)))
u_{1} = UnitOrthogonalVector(lineToShow_{1})
labelsPos_{1}: Points_{1}
horizVecToShow_{1} = Vector((x(Points_{1}(selectedPoints_{1}(2))), y(Points_{1}(selectedPoints_{1}(1)))), (x(Points_{1}(selectedPoints_{1}(2))), y(Points_{1}(selectedPoints_{1}(1)))) + horizVec_{1})
vertVecToShow_{1} = Vector(Points_{1}(selectedPoints_{1}(2)), Points_{1}(selectedPoints_{1}(2)) + vertVec_{1})
hor_{1}: -1
ver_{1}: 1
label1pos_{1} = Text(label1_{1}, labelsPos_{1}(1), true, true, hor_{1}, ver_{1})
label2pos_{1} = Text(label2_{1}, labelsPos_{1}(2), true, true, hor_{1}, ver_{1})
label3pos_{1} = Text(label3_{1}, labelsPos_{1}(3), true, true, hor_{1}, ver_{1})
label4pos_{1} = Text(label4_{1}, labelsPos_{1}(4), true, true, hor_{1}, ver_{1})
label5pos_{1} = Text(label5_{1}, labelsPos_{1}(5), true, true, hor_{1}, ver_{1})
xAxisLabel_{1} = Text("x", (16, 0), true, true, 0, 0)
yAxisLabel_{1} = Text("y", (0, 14.2), true, true, 1, 1)
orange_{1}: {199, 80, 0} / 255
brown_{1}: {144, 61, 20} / 255
onboardingX_{1}: 310
onboardingY_{1}: 100
onboardingText_{1}: "\text{" + (LaTeX[If[countClicks_{1} ≟ 0, "Click any two points", "Explore using other points"]]) + "}"
onboardingCase_{1}: 1
OnboardingTextOffset_{1} = onboardingTextOffset(Corner[onboardingText_{1}, 1], Corner[onboardingText_{1}, 3], onboardingCase_{1}, Corner[1], Corner[3], Corner[5])
onboardingDisplayText_{1}: "\text{\vphantom{Og}" + (LaTeX[onboardingText_{1}]) + "}"
pulsingSpeed_{1}: 8
isTypicalError: ¬correct
hintVec1 = Vector(P1, HintPoint)
hintVec2 = Vector(HintPoint, PointToUse)
f: y = y(MoveGuideLine_{1})
f' = Translate(f, Vector[(((-Vector[Corner[1], Corner[4]])) / 500 * 16)])
DeltaYnum_{1}: y(PointToUse) - y(P1)
tabOrder: {textQuestion, InputBoxA, btnValidate, textHint, textSolution, btnNew}

Tool: PixelsToPoint
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: expandSegment
expandSegment(A,B,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, pixelGap, Corner1, Corner3, Corner5
Output: newPoly

distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
pointGap: distanceX
xyScale: distanceY / distanceX
A: (0, 0)
vecAB: B - A
pVec: (20 * UnitVector[(((-y(vecAB))) / xyScale, (x(vecAB) * xyScale))])
pVecAngle = Angle(xAxis, Line[(0, 0), pVec])
realAngle = If(pVecAngle ≟ pi / 2 ∨ pVecAngle ≟ (3 * pi / 2), pVecAngle, atand(tan(pVecAngle) / xyScale))
curveFunction = CurveCartesian((pointGap * cos(u)), ((pointGap * xyScale) * sin(u)), u, 0, (2 * pi))
K: curveFunction(realAngle)
vSpace = Vector(K)
allPoints: {A + vSpace, A - vSpace, B - vSpace, B + vSpace}
newPoly = Polygon(allPoints)

Tool: onboardingTextOffset
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: centerText
centerText(sizeStr,textStr)
Input: sizeStr, textString
Output: centeredLatex

this is dynamic centered text

centeredLatex: (((("\begin{tabular}\hspace{" * sizeStr) * "}\\") * textString) * "\end{tabular}")

Tool: onboardingTextOffset (command onboardingTextOffset1)
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: onboardingTextOffset (command onboardingTextOffset11)
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: circlePixels
circlePixels(A,pixelRadius,Corner1,Corner3,Corner5
Input: A, pixelRadius, Corner1, Corner3, Corner5
Output: newCircle

pointRadius: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
newCircle = Circle(A, pointRadius)

Tool: onboardingTextOffset (command onboardingTextOffset2)
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)