$\text{TRY ANOTHER}$

x

y

\text{Refine your points location.}

$\bold\textsf{%x}$

$\bold\textsf{%y}$

$\bold\textsf{%y}$

$\bold\textsf{%x}$

$\text{DRAW TRIANGLE}$

$\text{SHOW ME}$

%v

%v

%v

\text{Try dragging the points so that the\
triangle is reflected across the line.}

\text{The segments connecting\
corresponding points are \
perpendicular to the line of\
reflection, and their midpoints\
lie on it.}

aniSol = 0 (slider from 0 to 6.5, step 0.01)
countQuestion = 0
allVert = Shuffle(Join[Sequence[Sequence[(j, k), j, -8, -2, 2], k, -8, -2, 2]])
A = If(countQuestion ≟ 0, (-8, -10), Element[allVert, Mod[countQuestion, Length[allVert]] + 1])
allVertMinusA: allVert \ {A}
B = If(countQuestion ≟ 0, (-4, -2), Element[allVertMinusA, Mod[countQuestion, Length[allVertMinusA]] + 1])
abLine = Line(A, B)
allIntPoints = Sequence((a, abLine(a)), a, -10, 10)
badPointsCollinear = KeepIf(IsInteger[y(A)], A, allIntPoints)
badPointsVertical = KeepIf(x(B) ≟ x(A) ∧ x(P) ≟ x(A), P, allVert)
allBadPoints = Union(badPointsCollinear, badPointsVertical)
allVertMinusBad: allVert \ allBadPoints
C = If(countQuestion ≟ 0, (-6, -10), Element[allVertMinusBad, Mod[countQuestion, Length[allVertMinusBad]] + 1])
given, c, a, b = Polygon(A, B, C)
givenVert: {Vertex[given]}
givenVertY: y(Sort[givenVert, y(givenVert)])
maxY = Max(givenVertY)
givenVertX: x(Sort[givenVert, x(givenVert)])
maxX = Max(givenVertX)
allCaseNum = Shuffle({1, 2})
caseNum = Element(allCaseNum, Mod[countQuestion, Length[allCaseNum]] + 1)
allShifts = Shuffle({1, 2})
shift = Element(allShifts, Mod[countQuestion, Length[allShifts]] + 1)
mirrorLine = If(caseNum ≟ 1, x = maxX + shift, y = maxY + shift)
CR = Mirror(C, mirrorLine)
vcs = Vector(C, CR)
BR = Mirror(B, mirrorLine)
vbs = Vector(B, BR)
AR = Mirror(A, mirrorLine)
vas = Vector(A, AR)
upOrDown = Shuffle({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2})
leftOrRight = Shuffle({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2})
aniTri = 0 (slider from 0 to 3.5, step 0.01)
maxDown: abs(-10 - givenVertY(1))
allDown = Shuffle(Sequence[n, n, 2, maxDown, 1])
yDown = Element(allDown, Mod[countQuestion, Length[allDown]] + 1)
maxUp: abs(10 - givenVertY(3))
allUp = Shuffle(Sequence[n, n, 2, maxUp, 1])
yUp = Element(allUp, Mod[countQuestion, Length[allUp]] + 1)
maxLeft: abs(-10 - givenVertX(1))
allLeft = Shuffle(Sequence[n, n, 2, maxLeft, 1])
xLeft = Element(allLeft, Mod[countQuestion, Length[allLeft]] + 1)
maxRight: abs(10 - givenVertX(3))
allRight = Shuffle(Sequence[n, n, 2, maxRight, 1])
xRight = Element(allRight, Mod[countQuestion, Length[allRight]] + 1)
ud = Element(upOrDown, Mod[countQuestion, Length[upOrDown]] + 1)
rl = Element(leftOrRight, Mod[countQuestion, Length[leftOrRight]] + 1)
Dims = Corner(5)
speed: 2
dragA = false
V1: (10, 0)
V2: (0, x(V1))
V4: (0, (-x(V1)))
V3: ((-x(V1)), 0)
megaGrid = Join(Sequence[Sequence[(j, k), j, -11, 11, 1], k, -11, 11, 1])
A' = Point(megaGrid)
B' = Point(megaGrid)
C' = Point(megaGrid)
dragB = false
dragC = false
vt: (If[rl ≟ 1, xRight, (-xLeft)], If[ud ≟ 1, yUp, (-yDown)])
correctA: A' ≟ AR
correctB: B' ≟ BR
correctC: C' ≟ CR
AB = Dilate(A', If[0 < aniTri ≤ 1, 1 - aniTri, 0], B')
ab = Segment(A', AB)
BC = Dilate(B', If[1 < aniTri ≤ 2, 2 - aniTri, 0], C')
bc = Segment(B', BC)
CA = Dilate(C', If[2 < aniTri ≤ 3, 3 - aniTri, 0], A')
ca = Segment(C', CA)
correct: correctA ∧ correctB ∧ correctC
studentTri, cs, as, bs = Polygon(A', B', C')
AS = Translate(A, Vector[If[0 < aniSol ≤ 1, Vector[(aniSol * vas)], vas]])
BS = Translate(B, Vector[If[1 ≤ aniSol ≤ 2, Vector[((aniSol - 1) * vbs)], vbs]])
ABS = Dilate(AS, If[3 < aniSol ≤ 4, 4 - aniSol, 0], BS)
CS = Translate(C, Vector[If[2 ≤ aniSol ≤ 3, Vector[((aniSol - 2) * vcs)], vcs]])
BCS = Dilate(BS, If[4 < aniSol ≤ 5, 5 - aniSol, 0], CS)
CAS = Dilate(CS, If[5 < aniSol ≤ 6, 6 - aniSol, 0], AS)
a' = Segment(AS, ABS)
b' = Segment(BS, BCS)
c' = Segment(CS, CAS)
A'_{1} = Translate(A, vt)
B'_{1} = Translate(B, vt)
C'_{1} = Translate(C, vt)
solTri, j, k, l = Polygon(AS, BS, CS)
test: abLine(2)
posA = IndexOf(A, allVert)
d: 24
tabOrder: {textToDo, A', B', C', btnDraw, textWakeUp, textOk, btnShow, btnNew, AS, BS, CS}
axisX = Segment((-11.03, 0), (11.03, 0))
axisY = Segment((0, -11.03), (0, 11.03))
peepPoli, f, g, h, i = Polygon((-11.05, -11.05), (11.05, -11.05), (11.05, 11.05), (-11.05, 11.05))
shortTicksX = Sequence(Segment[(t, -0.2), (t, 0.2)], t, -10, 10, 1)
shortTicksY = Sequence(Segment[(-0.2, t), (0.2, t)], t, -10, 10, 1)
onboarding = true
pulsingSpeed: 8
pulsing = 0 (slider from 0 to 1, step 0.1)
pulsingObject = circlePixels(A', 7 + (7 * pulsing), Corner[1], Corner[3], Corner[5])
va = Segment(A, A')
vb = Segment(B, B')
vc = Segment(C, C')
MVAS = Midpoint(A, AR)
MVBS = Midpoint(B, BR)
MVCS = Midpoint(C, CR)
segmA1 = Segment(A, MVAS)
segmA2 = Segment(MVAS, AR)
segmB1 = Segment(B, MVBS)
segmB2 = Segment(MVBS, BR)
segmC1 = Segment(C, MVCS)
segmC2 = Segment(MVCS, CR)
angB = Angle(MVBS, MVCS, CR)

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: PixelsToPoint (command PixelsToPoint2)
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: 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)