$\mathsf{%v}$

$\mathsf{%v}$

$\mathsf{%v}$

#4D4D4D

$\text{Check}$

$\text{TRY AGAIN}$

$\text{NEW PROBLEM}$

No selection allowed for all input boxes

Fix position and allow selection for all text objects

Empty all input boxes

Reset app

\text{This is the error specific hint}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{This is the general hint}

\text{Can the three segments shown form a triangle?} 

#eeeeee

#ffffff

$\text{YES}$

$\text{NO}$

$\mathsf{%v}$

$\mathsf{%v}$

$\mathsf{%v}$

$\mathsf{%v}$

$\mathsf{%v}$

$\rotatebox{90}{\textsf{animation speed}}$

\text{Drag to explore}

countQuestion = 0
randomOrderList = Shuffle(Sequence[Random[1, 3], i, 1, 100])
randomOrder = Element(randomOrderList, Mod[countQuestion, 100] + 1)
randomSideList2 = Shuffle(Sequence[Random[10, 30], i, 1, 100])
randomSide2 = Element(randomSideList2, Mod[countQuestion, 100] + 1)
randomSideList1 = Shuffle(Sequence[Random[20, 50], i, 1, 100])
randomSide1 = Element(randomSideList1, Mod[countQuestion, 100] + 1)
randomSideAddendList = Shuffle(Sequence[Random[-10, 5], i, 1, 100])
randomSide3: randomSide1 + randomSide2 + Element[randomSideAddendList, Mod[countQuestion, 100] + 1]
totalWidth: randomSide1 + randomSide2 + randomSide3
totalHeight: (2 * Max[First[Sort[{randomSide1, randomSide2, randomSide3}], 2]])
sideOrder = Sort({randomSide1, randomSide2, randomSide3})
xMax: (Element[sideOrder, 3] * 3)
maxXGrid: (5 / 8 * xMax)
yMax: (xMax * 5 / 8)
sideStartPoints: {(0, (yMax * 3 / 5)), (0, (yMax * 2 / 5)), (0, (yMax * 1 / 5))}
PointSideStart2 = Element(sideStartPoints, Mod[randomOrder + 1, 3] + 1)
PointSideStart3 = Element(sideStartPoints, Mod[randomOrder + 2, 3] + 1)
PointSideStart1 = Element(sideStartPoints, Mod[randomOrder, 3] + 1)
sideCircle1 = Circle(PointSideStart1, randomSide1)
sideRay1 = Ray(PointSideStart1, Vector[(1, 0)])
side1 = Segment(PointSideStart1, Intersect[sideCircle1, sideRay1])
PointSideEnd1: PointSideStart1 + (Length[side1], 0)
maxYGrid: (5 / 6 * yMax)
yMin: ((-yMax)) / 10
minYGrid: ((-yMin)) / 2
boxHeight: maxYGrid - minYGrid
ratioHeight: boxHeight / totalHeight
ySolution: (maxYGrid + minYGrid) / 2
xMin: ((-xMax)) / 10
minXGrid: xMin / 2
boxWidth: maxXGrid - minXGrid
ratioWidth: boxWidth / totalWidth
ratioChoice = Min({1, ratioHeight, ratioWidth})
solutionLengths: ({randomSide1, randomSide2, randomSide3} * ratioChoice)
xSolutionStart: minXGrid + (boxWidth - Sum[solutionLengths]) / 2
xSolution1: xSolutionStart + solutionLengths(2)
PointStartAnimationS1_a: (xSolution1, ySolution)
animationRange3 = Distance(PointSideStart2, PointStartAnimationS1_a)
animationRange1 = Distance(PointSideStart3, PointStartAnimationS1_a)
xMiddle: (xMin + xMax) / 2
xAnimationEnd: xMiddle + sideOrder(3) / 2
animationRange5 = Distance(PointSideEnd1, (xAnimationEnd, y(PointStartAnimationS1_a)))
animationRange: animationRange1 + animationRange3 + animationRange5 + 3
xSolution2: xSolution1 + solutionLengths(3)
PointStartAnimationS2_a: (xSolution2, ySolution)
animationStart3: animationRange1 + 1
animationStart5: animationStart3 + animationRange3 + 1
animationSlider = 0 (slider from 0 to animationRange, step 0.01)
animationSlider5 = If(animationSlider < animationStart5, 0, animationSlider < animationRange, animationSlider - (animationStart5 + 1), animationRange5)
PointMoveAnimation5 = PartitionPoint(PointSideStart1 + (sideOrder(2), 0), PointStartAnimationS2_a, animationSlider5, animationRange5)
circleSolution2 = Circle(PointMoveAnimation5, solutionLengths(1))
animationSlider3 = If(animationSlider < animationStart3, 0, animationSlider < animationStart5, animationSlider - (animationStart3 + 1), animationRange3)
PointMoveAnimation3 = PartitionPoint(PointSideStart2, PointStartAnimationS1_a, animationSlider3, animationRange3)
circleSolution1 = Circle(PointMoveAnimation3, solutionLengths(2))
PointStartAnimationS1_b: (xSolution1, ySolution + solutionLengths(2))
xAnimationStart: xMiddle - sideOrder(3) / 2
PointStartAnimation7: PointMoveAnimation5 - (Length[side1], 0)
sideRay2 = Ray(PointSideStart2, Vector[(1, 0)])
sideCircle2 = Circle(PointSideStart2, randomSide2)
side2 = Segment(PointSideStart2, Intersect[sideCircle2, sideRay2])
PointMoveAnimation3b = PartitionPoint(PointSideStart2 + (sideOrder(1), 0), PointStartAnimationS1_b, animationSlider3, animationRange3)
sideRay3 = Ray(PointSideStart3, Vector[(1, 0)])
sideCircle3 = Circle(PointSideStart3, randomSide3)
side3 = Segment(PointSideStart3, Intersect[sideCircle3, sideRay3])
PointEndAnimation: (xAnimationEnd, yMax / 4)
correctIndex = If(sideOrder(1) + sideOrder(2) > sideOrder(3), 1, 2)
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
input1 = 0
correct: correctIndex ≟ input1
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
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)}])
Dims = Corner(5)
enableBtnValidate: ¬validate
labelBtnValidate: "\text{CHECK (" + (LaTeX[1 - tries]) + ")}"
animationSlider1 = If(animationSlider < animationRange1, animationSlider, animationRange1)
PointMoveAnimation1 = PartitionPoint(PointSideStart3, PointStartAnimationS1_a, animationSlider1, animationRange1)
animationStart1: 0
textInequality = If(sideOrder(1) + sideOrder(2) < sideOrder(3), "<", sideOrder(1) + sideOrder(2) > sideOrder(3), ">", "=")
textAnswer: "\text{\[" + (LaTeX[sideOrder(1)]) + "+" + (LaTeX[sideOrder(2)]) + " " + (LaTeX[textInequality]) + " " + (LaTeX[sideOrder(3)]) + "\]}"
textInequalityWord = If(sideOrder(1) + sideOrder(2) < sideOrder(3), "less than", sideOrder(1) + sideOrder(2) > sideOrder(3), "greater than", "equal to")
textCanCannot = If(correctIndex ≟ 1, "can", "cannot")
PointMoveAnimation3c_{1} = Point(circleSolution1)
solutionGridArea = Polygon({(minXGrid, minYGrid), (minXGrid, maxYGrid), (maxXGrid, maxYGrid), (maxXGrid, minYGrid)})
PointStartAnimationS2_b: PointStartAnimationS2_a + (0, solutionLengths(1))
PointMoveAnimation1b = PartitionPoint(PointSideStart3 + (sideOrder(3), 0), PointStartAnimationS2_a, animationSlider1, animationRange1)
segmentAnimation1 = Segment(PointMoveAnimation1, PointMoveAnimation1b)
segmentAnimation3 = Segment(PointMoveAnimation3, PointMoveAnimation3b)
PointMoveAnimation5b = PartitionPoint(PointSideStart1, PointStartAnimationS2_b, animationSlider5, animationRange5)
segmentAnimation5 = Segment(PointMoveAnimation5, PointMoveAnimation5b)
PointMoveAnimation7 = Point(circleSolution2)
PointMoveAnimation3c = Point(circleSolution1)
segmentAnimation6 = Segment(PointStartAnimationS1_a, PointMoveAnimation3c)
PointMoveAnimation5c = Point(circleSolution2)
segmentAnimation7 = Segment(PointStartAnimationS2_a, PointMoveAnimation5c)
PointSize: (0, 0)
textSide3: "" + (LaTeX[randomSide3]) + ""
textSide2: "" + (LaTeX[randomSide1]) + ""
textSide1: "" + (LaTeX[randomSide2]) + ""
PointStarts: {Midpoint[segmentAnimation1], If[animationSlider < animationRange, Midpoint[segmentAnimation3], Midpoint[segmentAnimation6]], If[animationSlider < animationRange, Midpoint[segmentAnimation5], Midpoint[segmentAnimation7]]}
textDims2: {{x(Corner[textSide3, 3]) - x(Corner[textSide3, 1]), y(Corner[textSide3, 3]) - y(Corner[textSide3, 1]), x(Corner[textSide3, 4] - PointSize), y(Corner[textSide3, 4] - PointSize)}, {x(Corner[textSide1, 3]) - x(Corner[textSide1, 1]), y(Corner[textSide1, 3]) - y(Corner[textSide1, 1]), x(Corner[textSide1, 4] - PointSize), y(Corner[textSide1, 4] - PointSize)}, {x(Corner[textSide2, 3]) - x(Corner[textSide2, 1]), y(Corner[textSide2, 3]) - y(Corner[textSide2, 1]), x(Corner[textSide2, 4] - PointSize), y(Corner[textSide2, 4] - PointSize)}}
PointTextStarts = Sequence(PointStarts(n) + (((-Element[textDims2, n, 1])) / 2, (5 * Element[textDims2, n, 2] / 4)) - (Element[textDims2, n, 3], Element[textDims2, n, 4]), n, 1, 3)
PointTextEnds: {PointTextStarts(1), PointStarts(2) - ((5 * Element[textDims2, 2, 1] / 4), ((-Element[textDims2, 2, 2])) / 2) - (Element[textDims2, 2, 3], Element[textDims2, 2, 4]), PointStarts(3) + (Element[textDims2, 3, 1] / 4, Element[textDims2, 3, 2] / 2) + (Element[textDims2, 3, 3], Element[textDims2, 3, 4])}
PointTexts: {PointTextStarts(1), PartitionPoint[PointTextStarts(2), PointTextEnds(2), animationSlider3, animationRange3], PartitionPoint[PointTextStarts(3), PointTextEnds(3), animationSlider5, animationRange5]}
displaySide1: "" + (LaTeX[textSide3]) + ""
displaySide2: "" + (LaTeX[textSide1]) + ""
displaySide3: "" + (LaTeX[textSide2]) + ""
xSolutionEnd: xSolution2 + solutionLengths(1)
PointTrace3c: PointMoveAnimation3c
PointTrace5c: PointMoveAnimation5c
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ Maybe next time}$"]]) + ""
textHint: "\text{\bold{\color{" + (LaTeX[colorOrange]) + "}{Hint}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " out of " + (LaTeX[countQuestion + 1]) + " }"
speed: 1000 / animationRange
textSolution: "\text{\bold{Possible Solution}\\\\
The sum of the lengths of\\any two 
sides of a triangle\\must be greater than the\\length of its third side. 
\\" + (LaTeX[sideOrder(1)]) + " + " + (LaTeX[sideOrder(2)]) + " = " + (LaTeX[sideOrder(1) + sideOrder(2)]) + " so the\\segments " + (LaTeX[textCanCannot]) + " form a\\triangle.
}"
onboardingCase: 2
onboarding = false
pulsingSpeed: 8
pulsing = 0 (slider from 0 to 1, step 0.1)
OnboardingPoint = PointToPixels(Corner[1], Corner[3], Corner[5], PointMoveAnimation5c)
onboardingX: x(OnboardingPoint) - 16 - 24
onboardingY: y(OnboardingPoint) + 12
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingTextX: onboardingX + x(OnboardingTextOffset)
onboardingTextY: onboardingY + y(OnboardingTextOffset)
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
pulsingObject = circlePixels(PointMoveAnimation5c, 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
onboardStart = false
Point3Copy = (16, 13.125)
Point5Copy = (0, 26.25)
PointMoved: Point3Copy ≠ PointMoveAnimation3c ∨ Point5Copy ≠ PointMoveAnimation5c
isTypicalError: false
tabOrder: {textQuestion, displaySide1, displaySide2, displaySide3, btnYes, btnNo, textFeedback, textAnswer, textSolution, PointMoveAnimation5c, PointMoveAnimation3c, textCountCorrect, 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: PixelsToPoint (command PixelsToPoint1)
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: PartitionPoint
PartitionPoint(P1,P2,Num,Den)
Input: SimMove, solutionPoint, animation1Slider, animation1Range
Output: Animation1Point

$\textbf{\mathsf{F}}$

Animation1Point: SimMove + (animation1Slider * (solutionPoint - SimMove) / animation1Range)

Tool: expandCircle
expandCircle(A,pixelRadius,Corner1,Corner3,Corner5)
Input: A, pixelRadius, Corner1, Corner3, Corner5
Output: newEllipse

distanceX: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelRadius / y(Corner5) * (y(Corner3) - y(Corner1)))
xyScale: distanceY / distanceX
pointGap: distanceX
cMinor = Min(pointGap, (pointGap * xyScale))
cMajor = Max(pointGap, (pointGap * xyScale))
f1: sqrt(cMajor^(2) - cMinor^(2))
A: (3, 4)
newEllipse = If(xyScale < 1, Ellipse[A + (f1, 0), A + ((-f1), 0), A + (cMajor, 0)], Ellipse[A + (0, f1), A + (0, (-f1)), A + (0, cMajor)])

Tool: PointToPixels
PointToPixels(Corner1,Corner3,Corner5,InputPoint)
Input: Corner1, Corner3, Corner5, InputPoint
Output: OutputPixels

Corner1: (-5, -5)
Corner3: (16, 6)
Corner5: (300, 200)
xLeft: x(Corner1)
xRight: x(Corner3)
yTop: y(Corner3)
yBottom: y(Corner1)
yPixels: (y(Corner5) * (yTop - y(InputPoint)) / (yTop - yBottom))
xPixels: (x(Corner5) * (x(InputPoint) - xLeft) / (xRight - xLeft))
OutputPixels: (xPixels, yPixels)

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: 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)