3

Element(randomCase, Mod(countQuestion, Length(randomCase)) + 1)

#4D4D4D

$\text{NEW ANGLE}$

Fix position and allow selection for all text objects

Empty all input boxes

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

\text{Discover three ways to name this angle by clicking the options below.}

$\text{OPTION 1}$

$\text{OPTION 2}$

$\text{OPTION 3}$

$\text{OPTION 1}$

$\text{OPTION 2}$

$\text{OPTION 3}$

animateControl > 0 ∧ displayCase ≟ 1 ∨ animateControl ≟ 2 ∧ displayCase ≟ 2

randomSeeds = RandomUniform(0, 0.99, 100)
randomCase = Shuffle(Sequence[6])
destinationOrder: {}
inputCurrent: destinationOrder
numRandoms: 4
countQuestion = 1
indexLetter: 1 + floor((randomSeeds(Mod[(numRandoms * countQuestion), Length[randomSeeds]] + 1) * 3))
letterSet = Element({{"A", "B", "C"}, {"L", "M", "N"}, {"X", "Y", "Z"}}, indexLetter)
caseNum = Element(randomCase, Mod[countQuestion, Length[randomCase]] + 1)
animateControl = 0 (slider from 0 to 2)
armLength: 2.5
AnchorFigure = (8.324, 5.5588)
indexRotation: 1 + floor((randomSeeds(Mod[(numRandoms * countQuestion) + 3, Length[randomSeeds]] + 1) * 6))
rotationAngle = Element({pi / 2, pi / 3, pi / 4, (3 * pi / 5), (2 * pi / 5), (2 * pi / 3), pi / 6, (5 * pi / 6)}, indexRotation)
PtB = Rotate(AnchorFigure + (armLength, 0), rotationAngle, AnchorFigure)
indexAngle: 1 + floor((randomSeeds(Mod[(numRandoms * countQuestion) + 2, Length[randomSeeds]] + 1) * 6))
currentAngle = Element({pi / 2, pi / 3, pi / 4, (3 * pi / 5), (2 * pi / 5), (2 * pi / 3), pi / 6, (5 * pi / 6)}, indexAngle)
PtA = Rotate(AnchorFigure + (armLength, 0), rotationAngle + currentAngle, AnchorFigure)
displayCase = NaN
displayPointsActual = Element({{PtA, AnchorFigure, AnchorFigure, PtB}, {PtB, AnchorFigure, AnchorFigure, PtA}, {AnchorFigure, PtA, AnchorFigure, PtB}}, displayCase)
caseMap = Element({{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}}, caseNum)
PointStudentCenter = If(Length[destinationOrder] ≟ 2, IndexOf[destinationOrder(2), caseMap], IndexOf[destinationOrder(3), caseMap])
PointStudentFirst = If(Length[destinationOrder] ≟ 2, Mod[PointStudentCenter, 3] + 1, IndexOf[destinationOrder(2), caseMap])
PointStudentThird = Element(Remove[{1, 2, 3}, {PointStudentCenter, PointStudentFirst}], 1)
displayOrderStudent = Element({{PointStudentCenter, PointStudentFirst, PointStudentCenter, PointStudentThird}, {PointStudentFirst, PointStudentCenter, PointStudentFirst, PointStudentCenter}, {PointStudentFirst, PointStudentCenter, PointStudentCenter, PointStudentThird}}, Length[destinationOrder] - 1)
displayPointsStudent = Zip(Element[{PtA, AnchorFigure, PtB}, A], A, displayOrderStudent)
displayPointsAnimate = If(displayCase ≟ 4, displayPointsStudent, displayPointsActual)
showFinalLabel: displayPointsActual(1) ≠ displayPointsActual(3) ∨ displayPointsActual(2) ≟ displayPointsActual(4)
studentPoints = Zip(Element[{PtA, AnchorFigure, PtB}, B], B, {PointStudentFirst, PointStudentCenter, PointStudentThird})
movingIndex = NaN
seedIndex: Mod[(3 * countQuestion), Length[randomSeeds] - 3] + 1
seed1: randomSeeds(seedIndex)
seed3: randomSeeds(seedIndex + 2)
seed2: randomSeeds(seedIndex + 1)
allText = Append(letterSet, "\angle")
currentLocations: {1, 2, -1, 3}
inputSaved: {}
layoutY: 200
layoutX: 16
layoutAppSize = Corner(5)
pulsingSpeed: 8
pulsing = 0.3 (slider from 0 to 1, step 0.1)
PTemp = (-2.0970947907731237, 3.706197659203899)
captionStep2: "\(x" + (LaTeX[If[displayCase ≥ 6, "\ge", "\le"]]) + "\)"
displayOrder = Sequence(letterSet(caseMap(i)), i, 1, 3)
angleInterior = Angle(PtB, AnchorFigure, PtA)
rayB = Segment(AnchorFigure, PtB)
rayA = Segment(AnchorFigure, PtA)
animate1 = If(displayPointsActual(1) ≠ displayPointsActual(3), If[animateControl < 1, animateControl, 1], animateControl / 2)
speed: 5
animate2 = If(displayPointsActual(1) ≠ displayPointsActual(3), If[animateControl < 1, 0, animateControl - 1], animateControl / 2)
coverBox = centerBox(7, 7, AnchorFigure)
captionCase3: "\text{\(\angle " + (LaTeX[displayOrder(2)]) + "\)}"
angleSoln = Angle(PtB, AnchorFigure, PtA)
lblAnimateFirst = Text(("" * displayOrder(1)), AnchorFigure + (1.2 * (PtA - AnchorFigure)), true, true, 0, 0)
lblAnimateSecond = Text(("" * displayOrder(2)), Midpoint[PtA, PtB] + (1.2 * (AnchorFigure - Midpoint[PtA, PtB])), true, true, 0, 0)
lblAnimateThird = Text(("" * displayOrder(3)), AnchorFigure + (1.2 * (PtB - AnchorFigure)), true, true, 0, 0)
showStudent = Sequence(animateControl ≥ Element[{0.1, 1, 2}, A] ∧ studentPoints(Element[{1, 2, 4}, A]) ≟ Element[{PtA, AnchorFigure, PtB}, A], A, 1, 3)
highlightLabels = Zip(animateControl > 0 ∧ displayPointsActual(1) ≟ A ∨ animateControl ≥ 1 ∧ displayPointsActual(2) ≟ A ∧ displayPointsActual(1) ≠ displayPointsActual(3) ∨ animateControl ≟ 2 ∧ displayPointsActual(4) ≟ A ∧ showFinalLabel, A, {PtA, AnchorFigure, PtB})
animationOn: 0 < animateControl < 2
namesShown: {false, false, false}
animateRay1 = Segment(displayPointsActual(If[displayPointsActual(1) ≟ displayPointsActual(3), 2, 1]), displayPointsActual(If[displayPointsActual(1) ≟ displayPointsActual(3), 1, 2]))
animateRay2 = Segment(displayPointsActual(3), displayPointsActual(4))
animatePoints = Zip(displayOrder(IndexOf[A, {PtA, AnchorFigure, PtB}]), A, {displayPointsActual(1), displayPointsActual(2), displayPointsActual(4)})
showFirst: animateControl > 0 ∧ displayPointsActual(1) ≟ PtA ∨ animateControl ≥ 1 ∧ displayPointsActual(2) ≟ PtA ∨ animateControl ≟ 2 ∧ displayPointsActual(4) ≟ PtA
showSecond: animateControl > 0 ∧ displayPointsActual(1) ≟ AnchorFigure ∨ animateControl ≥ 1 ∧ displayPointsActual(2) ≟ AnchorFigure ∨ animateControl ≟ 2 ∧ displayPointsActual(4) ≟ AnchorFigure
showThird: animateControl > 0 ∧ displayPointsActual(1) ≟ PtB ∨ animateControl ≥ 1 ∧ displayPointsActual(2) ≟ PtB ∨ animateControl ≟ 2 ∧ displayPointsActual(4) ≟ PtB
animateBranch1A = Segment(displayPointsActual(1), displayPointsActual(1) + (animate1 * (displayPointsActual(2) - displayPointsActual(1))))
animateBranch1B = Segment(displayPointsActual(3), displayPointsActual(3) + (animate2 * (displayPointsActual(4) - displayPointsActual(3))))
lblFirst = Text(("" * displayOrder(1)), AnchorFigure + (1.2 * (PtA - AnchorFigure)), true, true, 0, 0)
lblSecond = Text(("" * displayOrder(2)), Midpoint[PtA, PtB] + (1.2 * (AnchorFigure - Midpoint[PtA, PtB])), true, true, 0, 0)
lblThird = Text(("" * displayOrder(3)), AnchorFigure + (1.2 * (PtB - AnchorFigure)), true, true, 0, 0)
captionCase1: "\text{\(\angle " + (LaTeX[((displayOrder(1) * If[animateControl ≥ 1 ∨ namesShown(1) ∧ displayCase ≠ 1, displayOrder(2), ""]) * If[animateControl ≟ 2 ∨ namesShown(1) ∧ displayCase ≠ 1, displayOrder(3), ""])]) + "\)}"
captionCase2: "\(\angle " + (LaTeX[((displayOrder(3) * If[animateControl ≥ 1 ∨ namesShown(2) ∧ displayCase ≠ 2, displayOrder(2), ""]) * If[animateControl ≟ 2 ∨ namesShown(2) ∧ displayCase ≠ 2, displayOrder(1), ""])]) + "\)"
tabOrder: {textQuestion, captionCase1, captionCase2, captionCase3, bOption1, bOption2, bOption3, 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: centerBox
(width,height,CenterPoint)
Input: width, length, StartPoint
Output: myBox

StartPoint: (0, 0)
A: StartPoint + (((-width)) / 2, ((-length)) / 2)
D: A + (0, length)
B: A + (width, 0)
C: A + (width, length)
myBox = Polygon({A, B, C, D})

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: expandQuad
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C, D}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)

Tool: expandQuad (command expandQuad1)
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C, D}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)