#4D4D4D

$\text{NUEVA FIGURA}$

$a=\vphantom{b}$

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

$\textsf{\textbf{A}}$

$\textsf{\textbf{A^\prime}}$

\text{✓}

x

y

\text{Usa los deslizadores para mover el\objeto sobre su imagen.} 

input2 = 0 (slider from minInput2 to maxInput2, step 1)
listBasicVertices: {{(3, 0), (4, 2), (5, 0), (6, 3), (4, 6), (2, 2)}, {(0, 0), (4, 0), (4, 2), (2, 2), (4, 3), (4, 4), (0, 4), (0, 3), (2, 3), (0, 2)}, {(1, 8), (1, 2), (3, 4), (7, 2), (7, 8), (4, 5)}, {(4, 1), (6, 1), (6, 7), (2, 7), (2, 5), (4, 5)}, {(0, 0), (0, 4), (1, 4), (1, 1), (3, 1), (3, 2), (2, 2), (2, 3), (4, 3), (4, 0)}, {(3, 1), (4, 1), (6, 2), (6, 4), (4, 7), (2, 4), (2, 2)}}
randomList6 = Shuffle(Sequence[15])
input1 = 0 (slider from minInput1 to maxInput1, step 1)
vectorSt = Vector((input1, input2))
listCenters: {(4, 3), (2, 2), (4, 5), (4, 4), (2, 2), (4, 4)}
countQuestion = 2
randomNum6 = Mod(Element[randomList6, Mod[countQuestion, 15] + 1], 4)
randomList2 = Shuffle(Sequence[15])
randomNum2 = Element(randomList2, Mod[countQuestion, 15] + 1)
randomList1 = Shuffle(Sequence[20])
randomNum1: Mod[Element[randomList1, Mod[countQuestion, 20] + 1], 6] + 1
CenterPoint: listCenters(randomNum1)
radios: {3, 2, 3, 3, 2, 3}
radiusFig: radios(randomNum1)
listCoordInitCenter: Sequence[-8 + radiusFig, 8 - radiusFig] \ {0}
xInitCenter = Element(listCoordInitCenter, Mod[randomNum2, Length[listCoordInitCenter]] + 1)
randomList3 = Shuffle(Sequence[15])
randomNum3 = Element(randomList3, Mod[countQuestion, 15] + 1)
yInitCenter = Element(listCoordInitCenter, Mod[randomNum3, Length[listCoordInitCenter]] + 1)
vectorInitial = Vector(CenterPoint, (xInitCenter, yInitCenter))
CenterPointPre = Translate(CenterPoint, vectorInitial)
verticesPre = Rotate(Translate[listBasicVertices(randomNum1), vectorInitial], (90° * randomNum6), CenterPointPre)
randomList4 = Shuffle(Sequence[15])
randomNum4 = Element(randomList4, Mod[countQuestion, 15] + 1)
yInitCenterImg = Element(listCoordInitCenter \ Sequence[yInitCenter - 2, yInitCenter + 2], Mod[randomNum4, Length[listCoordInitCenter \ Sequence[yInitCenter - 2, yInitCenter + 2]]] + 1)
xInitCenterImg = Element(listCoordInitCenter \ Sequence[xInitCenter - 2, xInitCenter + 2], Mod[randomNum4, Length[listCoordInitCenter \ Sequence[xInitCenter - 2, xInitCenter + 2]]] + 1)
CenterPointImg: (xInitCenterImg, yInitCenterImg)
xMax: 22.5
yMin: -11.5
randomList7 = Shuffle(Sequence[15])
vectorTransl = Vector(CenterPointPre, CenterPointImg)
randomList5 = Shuffle(Sequence[15])
randomNum5 = Element(randomList5, Mod[countQuestion, 15] + 1)
InputBox1 = Textfield(input1)
correct: vectorSt ≟ vectorTransl
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)}])
layoutY: 192
layoutX: 16
layoutAppSize = Corner(5)
viewBox = Polygon({(9, 9), (-9, 9), (-9, -9), (9, -9)})
axisX = Segment((-9, 0), (9, 0))
axisY = Segment((0, -9), (0, 9))
FigurePre = Polygon(verticesPre)
verticesImg = Translate(verticesPre, vectorTransl)
FigureImg = Polygon(verticesImg)
A: verticesPre(1)
speed: 3
A': verticesImg(1)
yMax: 10
xMin: (8 / 5 * (yMin - yMax)) + xMax
verticesSt = Translate(verticesPre, vectorSt)
FigureSt = Polygon(verticesSt)
textMovementX: "\text{" + (LaTeX[abs(input1)]) + " unidad" + (LaTeX[If[abs(input1) ≟ 1, "", "es"]]) + " a la " + (LaTeX[If[input1 > 0, "derecha", "izquierda"]]) + "}"
textMovementY: "\text{\color{" + (LaTeX[colorPink]) + "}" + (LaTeX[abs(input2)]) + " unidad" + (LaTeX[If[abs(input2) ≟ 1, "", "es"]]) + " hacia " + (LaTeX[If[input2 > 0, "arriba", "abajo"]]) + "}"
minInput1: -8 - xInitCenter + radiusFig
minInput2: -8 - yInitCenter + radiusFig
maxInput2: 8 - yInitCenter - radiusFig
maxInput1: 8 - xInitCenter - radiusFig
posLblPointPre = Intersect(Circle[CenterPointPre, Distance[CenterPointPre, A] + 0.8], Ray[CenterPointPre, A])
posLblPointImg = Translate(posLblPointPre, vectorTransl)
lblA = Text("A", posLblPointPre, false, true, 0, 0)
lblA' = Text("A^\prime", posLblPointImg, false, true, 0, 0)
tabOrder: {input1, input2, btnNew}
textDescription: "\text{La figura se mueve \\\\\color{" + (LaTeX[colorPurpleDark]) + "}" + (LaTeX[If[input1 ≠ 0, textMovementX + (If[input2 ≠ 0, " \\y ", ""]), ""]]) + "" + (LaTeX[If[input2 ≠ 0, textMovementY, ""]]) + "\color{" + (LaTeX[colorBlack]) + "}.} "

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: 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) * (y(InputPoint) - yBottom) / (yTop - yBottom))
xPixels: (x(Corner5) * (x(InputPoint) - xLeft) / (xRight - xLeft))
OutputPixels: (xPixels, yPixels)

Tool: FromTo
(start,end,slider)
Input: A, B, t
Output: P

P: A + (t * (B - A))