$\textsf{\(A\)}$

UnitVector(Vector(RCenter, If(RCenter ≠ Vertex(basePoly, 1), Corner(basePoly * 1), Corner(basePoly * 2))))

$\textsf\textbf{\(A\)}$

$\textsf\textbf{\(A'\)}$

$\textsf\textbf{\(A''\)}$

$\textsf\textbf{\(A\)}$

$\textsf\textbf{\(A'\)}$

$\textsf\textbf{\(A''\)}$

$\textsf\textbf{\(A\)}$

$\textsf{\(B\)}$

$\textsf{Check}$

$\text{X}$

$\textsf{Restart}$

\fbox\textsf{Try again!}

\fbox\textsf{Well Done!}

$\textsf{TRY ANOTHER}$

\textsf{Transform shape \(A\) onto shape \(B\) without landing on the barrier.}

$\textsf\textbf{\(A'\)}$

$\textsf\textbf{\(A''\)}$

$\textsf{SHOW SOLUTION}$

$\textsf{TRY AGAIN}$

Cancel transformation

#C75000

$\text{REPLAY}$

$\textsf\textbf{\(B\)}$

$\textsf\textbf{\(B\)}$

$\textsf\textbf{\(B\)}$

$\text{SHOW SOLUTION}$

$\text{REPLAY}$

Refl1

Refl2

rCenter

rAngle

vTrans

RefMidPt

Move the shape into the visible \
\hspace{18mm}window.

Move the shape so it does\
\hspace{18mm}not hit the barrier.

Move the shape so it\\hspace{18mm}does not pass through the barrier.

\text{Select a\transformation}

caseNum = 1
ROTATION: 3
actions: {0, 0, 0}
barrierCorners: {(3.825, 4.199999999999999), (4.175, 3.8000000000000007), (8.175, 7.300000000000001), (7.825, 7.699999999999999)}
barrier1: barrierCorners
barrier3 = Rotate(barrierCorners, (2 * pi / 3), (6, 5))
barrier2 = Rotate(barrierCorners, pi / 3, (6, 5))
polyOriginal = Element(B4:B6, caseNum)
barrier = Polygon(Element[{barrier1, barrier2, barrier3}, Mod[caseNum, 3] + 1])
validRotationAngles = Sequence(A, A, 0, (2 * pi), pi / 12)
moveGrid = Flatten(Sequence[Sequence[(A, B), A, 0, 10], B, 0, 10])
Reflect1: (1, 4)
Reflect2 = (2, 5)
reflectionLine = Line(Reflect1, Reflect2)
RCenter = Point(moveGrid)
originalPoints = Element(A4:A6, caseNum)
polyPoints: {{}, {}, {}}
step = 0
basePoly = Polygon(If[step ≤ 1, originalPoints, polyPoints(step - 1)])
polyReflected = Mirror(basePoly, reflectionLine)
PTranslate1 = Vertex(basePoly, 1)
translateOffsets: PTranslate1 - (floor(x(PTranslate1)), floor(y(PTranslate1)))
translateGrid = Zip(A + translateOffsets, A, moveGrid)
PTranslate = Point(translateGrid)
vTranslate = Vector(PTranslate1, PTranslate)
polyTranslated = Translate(basePoly, vTranslate)
rotationCollision = RemoveUndefined(Sequence[If[IntersectPath[barrier, Rotate[basePoly, A, RCenter]] > 0, A], A, 0, (2 * pi), pi / 12])
vRotationZero: (2, 0)
RotationStart: RCenter + vRotationZero
rotationPoints = Sequence(Rotate[RotationStart, validRotationAngles(A), RCenter], A, 1, Length[validRotationAngles])
PRotation = Point(rotationPoints)
angleCounterClockwise = Angle(RotationStart, RCenter, PRotation)
polyRotated = Rotate(basePoly, angleCounterClockwise, RCenter)
displayPoly = If(step < 1, polyOriginal, Element[{polyTranslated, polyReflected, polyRotated}, actions(step)])
overlapPath: {IntersectPath[displayPoly, barrier]}
movingClockwise = true
angleClockwise = Angle(PRotation, RCenter, RotationStart)
stopRotation = false
StopPoint = Point(rotationPoints)
RotateFree = Point(rotationPoints)
TRANSLATION: 1
A4: {(1, 4), (4, 4), (3, 5)}
A5: {(3, 6), (5, 6), (4, 8), (3, 7)}
A6: {(1, 1), (4, 1), (4, 2), (2, 2), (2, 3), (1, 3)}
numVertices = Element({Length[A4], Length[A5], Length[A6]}, caseNum)
translatePath = Sequence(Segment[Vertex[basePoly, A], Vertex[basePoly, A] + vTranslate], A, 1, numVertices)
translateCollide = Zip(IntersectPath[A, barrier], A, translatePath)
collidePath: Sum[Zip[If[A > 0, 1, 0], A, translateCollide]] > 0 ∧ actions(step) ≟ TRANSLATION
E11: (2, 3)
D11: pi
C11 = (4, 2)
B6 = Polygon(A6)
solnStep = 3
stepTimer = 2 (slider from 0 to 2, step 0.1)
timerStep3 = If(solnStep < 3 ∨ solnStep ≟ 3 ∧ stepTimer < 1, 0, If[solnStep ≟ 3, stepTimer - 1, 1])
timerStep1 = If(solnStep ≟ 1, If[stepTimer < 1, 0, stepTimer - 1], 1)
C6 = Rotate(B6, (timerStep1 * D11), C11)
timerStep2 = If(solnStep < 2 ∨ solnStep ≟ 2 ∧ stepTimer < 1, 0, If[solnStep ≟ 2, stepTimer - 1, 1])
A11: (2, 2)
B11: (1, 1)
D6 = If(timerStep2 < 0.5, C6, Mirror[C6, Line[A11, B11]])
E10: (-1, -1)
D10: pi / 2
C10 = (6, 5)
B5 = Polygon(A5)
A10: (2, 5)
B10: (8, 5)
C5 = If(timerStep1 < 0.5, B5, Mirror[B5, Line[A10, B10]])
D5 = Translate(C5, (timerStep2 * E10))
E9: (1, -3)
B9: (7, 5)
A9: (5, 7)
B4 = Polygon(A4)
C9: (3, 5)
D9: pi / 2
viewbox = Polygon({(-1, -0.5), (-1, 10.5), (10.5, 10.5), (10.5, -1)})
picCurrent = Element({broken1, broken2, broken3}, caseNum)
picTranslate = Translate(picCurrent, vTranslate)
picReflect = Mirror(picCurrent, reflectionLine)
picRotate = Rotate(picCurrent, angleCounterClockwise, RCenter)
studentPoints: {{}, {}, {}}
studentStages = Sequence(Polygon[studentPoints(A)], A, 1, step - 1)
allPoly: {polyTranslated, polyReflected, polyRotated}
NOACTION: 0
polyResult = Element(F4:F6, caseNum)
Anchor1_{1} = (-11.231928467264394, 7.074939748696683)
stepAnchors: {Anchor1_{1}, Anchor1_{1} + (0, -2.2), Anchor1_{1} + (0, -4.4)}
IconAnchor = (-11.231928467264394, 6.177159773324049)
textTranslation: "\text{\\Translate by the vector \(( " + (LaTeX[x(vTranslate)]) + "," + (LaTeX[y(vTranslate)]) + ")\)}"
textReflect: "\text{Reflect across the line through\\
\(" + (LaTeX[Reflect1]) + "\) and \(" + (LaTeX[Reflect2]) + "\)"
textRotation: "\text{Rotate " + (LaTeX[If[movingClockwise, (("clockwise by \(" * angleClockwise) * "\)"), (("counterclockwise by \(" * angleCounterClockwise) * "\)")]]) + "\\around the point \(" + (LaTeX[RCenter]) + "\)}"
speed: 5
prevTrans = 1
pixelsRight_{1}: 16
pixelsLeft_{1}: 16
pixelsBottom_{1}: 16
pixelsTop_{1}: 16
borderBox_{1} = Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], CLIPBOARDmagicSTRINGA], CLIPBOARDmagicSTRINGA, {(pixelsLeft_{1}, pixelsTop_{1}), (pixelsLeft_{1}, y(Corner[5]) - pixelsBottom_{1}), Corner[5] - (pixelsRight_{1}, pixelsBottom_{1}), (x(Corner[5]) - pixelsRight_{1}, pixelsTop_{1})}])
REFLECTION: 2
textAnchors: stepAnchors + (1.5, 0)
allText: {textTranslation, textReflect, textRotation}
polyResultOutline: polyResult
polyOriginalOutline: polyOriginal
clockwiseOK = true
counterclockwiseOK = true
collideObject: overlapPath(1) > 0 ∨ actions(step) ≟ ROTATION ∧ (¬clockwiseOK) ∧ (¬counterclockwiseOK)
collision: collidePath ∨ collideObject
outOfRange = If(Defined[displayPoly], IntersectPath[displayPoly, viewbox] ≠ displayPoly, false)
barrierBackground: barrier
youWin: Sum[Sequence[Vertex[displayPoly, A] ≟ Vertex[polyResult, A], A, 1, numVertices]] ≟ numVertices
validate = false
C4 = Rotate(B4, (timerStep1 * D9), C9)
D4 = If(timerStep2 < 0.5, C4, Mirror[C4, Line[A9, B9]])
E4 = Translate(D4, Vector[(timerStep3 * E9)])
polyStart: {{}, {}, {}}
showsolution = false
textTransformationsTitle: "\textsf{" + (LaTeX[If[showsolution, "One possible", "Your"]]) + " sequence of transformations:}"
K5: (1, 4)
vRotation = Vector(RCenter, PRotation)
StartHint = (6.66, -3.8999999999999995)
rotationArc = CircleArc(RCenter, Vertex[basePoly, 1], Rotate[Vertex[basePoly, 1], angleCounterClockwise, RCenter])
RStart = Rotate(Vertex[basePoly, 1], angleCounterClockwise, RCenter)
TempPoint: (1, 4)
reflectGuidePoints: {Vertex[basePoly, 1], Midpoint[Vertex[basePoly, 1], Vertex[displayPoly, 1]], Vertex[displayPoly, 1]}
reflectGuides: {Segment[reflectGuidePoints(1), reflectGuidePoints(2)], Segment[reflectGuidePoints(2), reflectGuidePoints(3)]}
textStudent: {"", "", ""}
studentText: {"", "", ""}
polyAnswer: polyResult
I6 = Text((("\text{Step 3: Translate by the vector\\\(" * E11) * "\)}"), stepAnchors(3), true, true, 1, 0)
buttonsActive: (¬collision) ∧ (¬outOfRange) ∧ (¬showsolution)
F4 = Translate(Mirror[Rotate[B4, D9, C9], Line[A9, B9]], E9)
F5 = Rotate(Translate[Mirror[B5, Line[A10, B10]], E10], D10, C10)
F6 = Translate(Mirror[Rotate[B6, D11, C11], Line[A11, B11]], E11)
E5 = Rotate(D5, (timerStep3 * D10), C10)
E6 = Translate(D6, (timerStep3 * E11))
initialized = false
L6 = Sequence(Vector[Vertex[D6, K], Vertex[E6, K]], K, 1, 6)
offsetX: floor(x(Vertex[basePoly, 1]))
PStartTransformation = Vertex(basePoly, 1)
K4: {Line[A9, B9], A9, B9}
J4: {C9, CircleArc[C9, Vertex[B4, 1], Vertex[C4, 1]]}
F9 = Intersect(Line[A9, B9], Line[Vertex[C4, 2], Vertex[D4, 2]])
L4: {Segment[Vertex[D4, 2], F9], Segment[Vertex[C4, 2], F9]}
M4 = Sequence(Vector[Vertex[D4, K], Vertex[E4, K]], K, 1, Length[A4])
F11 = Intersect(Line[A11, B11], Line[Vertex[C6, 2], Vertex[D6, 2]])
J5: {A10, B10, Line[A10, B10]}
N5 = Sequence(Vector[Vertex[C5, K], Vertex[D5, K]], K, 1, Length[A5])
F10 = Intersect(Line[A10, B10], Line[Vertex[C5, 1], Vertex[B5, 1]])
L5: {Segment[Vertex[C5, 1], F10], Segment[Vertex[B5, 1], F10]}
M5: {C10, CircleArc[C10, Vertex[D5, 3], Vertex[E5, 3]]}
J6: {A11, B11, Line[A11, B11]}
K6: {CircleArc[C11, Vertex[B6, 2], Vertex[C6, 2]], C11}
M6: {Segment[Vertex[C6, 2], F11], Segment[Vertex[D6, 2], F11]}
BrokenAnchors: {Vertex[basePoly, 1], Vertex[basePoly, 2]}
displayPic = Element({picTranslate, picReflect, picRotate}, actions(step))
rotationSpace = Circle(RCenter, 1)
textHint: "\text{\textcolor{" + (LaTeX[colorHint]) + "}{HINT} " + (LaTeX[If[collideObject, textCollision, If[collidePath, textCollidePath, textOutOfRange]]]) + "}"
moveVectors = Sequence(Vector[IconAnchor, Element[stepAnchors, A]], A, 1, step)
stepImages = Zip(Translate[Element[{iconTranslate, iconReflect, iconRotate}, A], Vector[B]], A, actions, Vector[B], moveVectors)
saveType: {2, 2, 1}
saveP1: {(1, 4), (3, 1), (9.759999999999998, 5.679999999999995)}
saveP2: {(2, 5), (4, 2), (9.759999999999998, 5.679999999999995)}
displaySavedSteps = Sequence(Text[studentText(A), textAnchors(A) + (0, 0.4), true, true, 1, 0], A, 1, step - 1)
displayCurrentStep = Text(Element[{textTranslation, textReflect, textRotation}, actions(step)], textAnchors(step) + (0, 0.4), true, true, 1, 0)
vAnchorRotate = (-0.4470699905395552, -0.44435775476404027)
resetDirection = false
direction = 2
tempIndex = 1
maxCounterclockwiseIndex = IndexOf(true, rotationCollision)
maxClockwiseIndex: Length[rotationCollision] - IndexOf[true, Reverse[rotationCollision]] + 1
clockwiseArc = CircleArc(RCenter, Rotate[Vertex[basePoly, 1], angleCounterClockwise, RCenter], Vertex[basePoly, 1])
G4 = Text((((("\text{Step 1: Rotate counterclockwise by " * (D9 * 180 / pi)) * "^\circ \\\hspace{22mm}around the point \(") * C9) * "\)}"), stepAnchors(1), true, true, 1, 0)
H4 = Text((((("\text{Step 2: Reflect across the line through\\\hspace{22mm}the points \(" * A9) * "\) and \(") * B9) * "\) }"), stepAnchors(2), true, true, 1, 0)
I4 = Text((("\text{Step 3: Translate by the vector \(" * E9) * "\)\\\phantom{line 2}}"), stepAnchors(3), true, true, 1, 0)
H5 = Text((("\text{Step 2: Translate by the vector \(" * E10) * "\)\\\vphantom{line 2}}"), stepAnchors(2), true, true, 1, 0)
H6 = Text((((("\text{Step 2: Reflect across the line through \\\hspace{22mm}the points \(" * A11) * "\) and \(") * B11) * "\)}"), stepAnchors(2), true, true, 1, 0)
G6 = Text((((("\text{Step 1: Rotate counterclockwise by " * (D11 * 180 / pi)) * "^\circ \\\hspace{22mm}around the point \(") * C11) * "\)}"), stepAnchors(1), true, true, 1, 0)
G5 = Text((((("\text{Step 1: Reflect across the line through\\\hspace{22mm}the points \(" * A10) * "\)  and \(") * B10) * "\)}"), stepAnchors(1), true, true, 1, 0)
vRotationStart = UnitVector(Vector[RCenter, Rotate[RCenter + (2, 0), pi / 6, RCenter]])
translateGuides = Sequence(Vector[Vertex[basePoly, A], Vertex[basePoly, A] + vTranslate], A, 1, numVertices)
rotationGuide = Segment(RCenter, RCenter + vRotation)
I5 = Text((((("\text{Step 3: Rotate counterclockwise by " * (D10 * 180 / pi)) * "^\circ \\\hspace{22mm}around the point ") * C10) * "}"), stepAnchors(3), true, true, 1, 0)
stageLabels = Zip(Text[(("\textsf{A^{" * A) * "}}"), Vertex[B, 1], true, true, -1, -1], A, {"\prime", "\prime\prime", "\prime\prime\prime"}, B, studentStages)

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)