$\bold\mathsf{%v}$

$\bold\mathsf{%v}$

#4D4D4D

$\text{Check}$

$\text{NUEVO}$

Fix position and allow selection for all text objects

Empty all input boxes

\text{This is the answer.}

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

#eeeeee

#2E006758

#2EB00020

\text{Escribe la ecuación de la recta determinada por los dos puntos dados.} 

$\math{y=}$

Next

Prev

countQuestion = 0
randomList4 = Shuffle(Sequence[-8, 8])
randomNum4 = Element(randomList4, Mod[countQuestion, Length[randomList4]] + 1)
randomList2 = Shuffle(Sequence[-8, 8])
randomNum2 = Element(randomList2, Mod[countQuestion, 15] + 1)
randomList1 = Shuffle(Sequence[-8, 8])
randomNum1 = Element(randomList1, Mod[countQuestion, Length[randomList1]] + 1)
steps: Sequence[0, 4] \ {If[randomNum1 ≟ 0, 3, 10], If[randomNum2 ≟ 0, 4, 10]}
P1: (randomNum1, randomNum2)
randomList3 = Shuffle(Sequence[-8, 8] \ {randomNum1})
randomNum3 = Element(randomList3, Mod[countQuestion, Length[randomList3]] + 1)
P2: (randomNum3, randomNum4)
expLine(x) = (Slope[Line[P1, P2]] * (x - x(P1))) + y(P1)
animSol = 0 (slider from minAnimSol to maxAnimSol)
PRight = If(randomNum3 ≤ randomNum1, P1, P2)
PLeft = If(randomNum1 ≤ randomNum3, P1, P2)
Pmid: (x(PRight), y(PLeft))
showsolution = false
studLine(x) = ?
correct = AreEqual(expLine, studLine)
animIncorrect: (¬correct) ∧ (¬showsolution)
animHint = 0 (slider from 0 to 1)
inputSaved: {NaN, NaN}
input1: 1
input2: 5
inputCurrent: {Slope[studLine], studLine(0)}
validate = false
showanswer = false
tries = 0
countCorrect = 0
showhint = false
isTypicalError: input2 ≟ input1 + 1
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent]
helpTextHint: "\text{" + (LaTeX[If[Slope[studLine] ≟ Slope[expLine], "Intenta trasladar tu recta\\hacia arriba o abajo.", "Observa los catetos del triángulo\\de pendiente en el gráfico."]]) + "}"
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: 158 - 24
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 16
layoutAppSize = Corner(5)
ViewCorner1_{1}: (-9.3, -9.3)
ViewCorner3_{1}: (9.3, 9.3)
q1_{1} = Polygon({ViewCorner1_{1}, (x(ViewCorner3_{1}), y(ViewCorner1_{1})), ViewCorner3_{1}, (x(ViewCorner1_{1}), y(ViewCorner3_{1}))})
xAxisFake_{1} = Segment((x(ViewCorner1_{1}), 0), (x(ViewCorner3_{1}), 0))
yAxisFake_{1} = Segment((0, y(ViewCorner1_{1})), (0, x(ViewCorner3_{1})))
Cor1 = (-27.777089823891007, -12.364584929744137)
Cor3 = (10.64221213294487, 11.78694966656867)
InputBox1 = Textfield(studLine)
hintSegment1 = Segment(PLeft, Translate[PLeft, Vector[((Min[animHint, 0.5] * 2) * Vector[PLeft, (x(PRight), y(PLeft))])]])
hintSegment2 = Segment((x(PRight), y(PLeft)), Translate[(x(PRight), y(PLeft)), Vector[((Min[animHint - 0.5, 1] * 2) * Vector[(x(PRight), y(PLeft)), PRight])]])
prevTriesm: {}
speed: 3
solSegment = IntersectPath(Line[(0, 0), (1, Slope[expLine])], q1_{1})
EP1 = Vertex(solSegment, 1)
EP2 = Vertex(solSegment, 2)
MoveGL = (-10.15052201343617, -9.333615448533566)
f: y = y(MoveGL)
labelY = Text("y", (0, y(ViewCorner3_{1}) - y(ViewCorner3_{1} - ViewCorner1_{1}) / 27), true, true, 1, 0)
animStudAns = 0 (slider from 0 to 1)
studAnimSeg = IntersectPath(Line[(0, studLine(0)), (1, studLine(1))], q1_{1})
EP1s = Vertex(studAnimSeg, 1)
EP2s = Vertex(studAnimSeg, 2)
studLineAnimated = CurveCartesian(TT, studLine(TT), TT, Min[x(EP1s), x(EP2s)], Min[x(EP1s), x(EP2s)] + (animStudAns * (Max[x(EP1s), x(EP2s)] - Min[x(EP1s), x(EP2s)])))
numStSlope = Numerator(Slope[studLine])
denStSlope = Denominator(Slope[studLine])
verticalSolSeg = Segment(Pmid - ((Min[animSol, 0.5] * 2) * (Pmid - (1, 0))), PRight - ((Min[animSol, 0.5] * 2) * (PRight - (1, Slope[expLine]))))
red: If[animIncorrect, 223, 0] / 255
green: If[animIncorrect, 115, 103] / 255
blue: If[animIncorrect, 20, 88] / 255
labelHint2 = Text(Text[y(PRight) - y(PLeft)], Midpoint[hintSegment2] + (0.5, 0), true, true, 1, 0)
labelHint1 = Text(Text[abs(x(P2) - x(P1))], Midpoint[hintSegment1] + (0, If[y(PRight) ≥ y(PLeft), 0, 0.8]), true, true, 0, If[y(PRight) ≥ y(PLeft), -1, 1])
animLine = Translate(Translate[(Slope[expLine] * x), Vector[((x(P1) * Min[Max[0, animSol - 2], 1]), 0)]], Vector[(0, (y(P1) * Max[animSol - 3, 0]))])
u = Vector((0, 0), ((Min[animSol - 2, 1] * x(P1)), 0))
v = Vector((x(P1), 0), (x(P1), (Max[0, animSol - 3] * y(P1))))
step = 0
minAnimSol = If(step ≤ 2, 0, step - 1)
maxAnimSol = If(step ≤ 2, 1, step)
labelHorVect = Text(x(P1), (x(P1) / 2, 1), true, true, 0, 1)
solLine = CurveCartesian(TT, animLine(TT), TT, Min[x(EP1), x(EP2)], Min[x(EP1), x(EP2)] + (((animSol - 0.5) * 2) * (Max[x(EP1), x(EP2)] - Min[x(EP1), x(EP2)])))
labelVecVert = Text(y(P1), (x(P1) + 0.5, y(P1) / 2), true, true, If[x(P1) ≥ 0, 1, -1], 0)
xbuttonPrev: 200
ybuttonPrev: 448
prevTriesb: {}
f' = Translate(f, Vector[(Vector[Corner[4], Corner[1]] / 500 * 8)])
prev2(x) = If[x(ViewCorner1_{1}) ≤ x ≤ x(ViewCorner3_{1}) ∧ y(ViewCorner1_{1}) ≤ (Element[prevTriesm, 2] * x) + Element[prevTriesb, 2] ≤ y(ViewCorner3_{1}), (Element[prevTriesm, 2] * x) + Element[prevTriesb, 2]]
eq1: x = x(Corner[2]) - (x(Corner[2] - Corner[1]) / 800 * 24)
horizontalSolSegment = Segment(PLeft - ((PLeft * Min[animSol, 0.5]) * 2), Pmid - ((Min[animSol, 0.5] * 2) * (Pmid - (1, 0))))
labelSlopeSmall = Text("1", (0.5, If[Slope[expLine] ≥ 0, 0, 0.7]), true, true, 0, If[Slope[expLine] ≥ 0, -1, 1])
text3 = Text((If[Slope[expLine] ≥ 0, "", "-"] * FractionText[abs(Slope[expLine])]), Midpoint[verticalSolSeg] + (0.5, 0), true, true, 1, 0)
prev1(x) = If[x(ViewCorner1_{1}) ≤ x ≤ x(ViewCorner3_{1}) ∧ y(ViewCorner1_{1}) ≤ (Element[prevTriesm, 1] * x) + Element[prevTriesb, 1] ≤ y(ViewCorner3_{1}), (Element[prevTriesm, 1] * x) + Element[prevTriesb, 1]]
enableBtnNext: step ≤ 3 ∧ (animHint ≟ 1 ∨ animHint ≟ 0) ∧ (animSol ≟ maxAnimSol ∨ animSol ≟ minAnimSol)
enableBtnPrev: step ≥ 1 ∧ (animHint ≟ 1 ∨ animHint ≟ 0) ∧ (animSol ≟ maxAnimSol ∨ animSol ≟ minAnimSol)
cuadPointLeft = If(x(PLeft) ≥ 0, If[y(PLeft) ≥ 0, 1, 4], If[y(PLeft) ≥ 0, 2, 3])
cuadPointRight = If(x(PRight) ≥ 0, If[y(PRight) ≥ 0, 1, 4], If[y(PRight) ≥ 0, 2, 3])
cuadPointMid = If(x(Pmid) ≥ 0, If[y(Pmid) ≥ 0, 1, 4], If[y(Pmid) ≥ 0, 2, 3])
cuadLine = If(Slope[expLine] ≥ 0, 1, 4)
cuadToUse = Element(Sequence[4] \ {cuadLine, cuadPointLeft, cuadPointRight, cuadPointMid}, 1)
PointTextSteps = Element({(1, 8), (-9, 9), (-9, -1), (1, -1)}, cuadToUse)
showprev1 = false
showprev2 = false
step1: "\textsf{Determina la pendiente de la recta: }\\m=\dfrac{y_{2}-y_{1}}{x_{2}-x_{1}}=\dfrac{" + (LaTeX[y(P2)]) + "-" + (LaTeX[((If[y(P1) ≥ 0, "", "("] * y(P1)) * If[y(P1) ≥ 0, "", ")"])]) + "}{" + (LaTeX[x(P2)]) + "-" + (LaTeX[((If[x(P1) ≥ 0, "", "("] * x(P1)) * If[x(P1) ≥ 0, "", ")"])]) + "}=" + (LaTeX[((If[Slope[expLine] ≥ 0, "", "-"] * "\displaystyle") * FractionText[abs(Slope[expLine])])]) + ""
step2: "\textsf{Usa la pendiente para graficar }
y = " + (LaTeX[((If[Slope[expLine] ≥ 0, "", "-"] * "\displaystyle") * FractionText[abs(Slope[expLine])])]) + "x."
step3: "\textsf{Traslada la recta }" + (LaTeX[abs(randomNum1)]) + " 
 \textsf{ unidad" + (LaTeX[If[abs(randomNum1) ≟ 1, "", "es"]]) + " a la " + (LaTeX[If[randomNum1 ≤ 0, "izquierda", "derecha"]]) + ".}\\
y=" + (LaTeX[((If[Slope[expLine] ≥ 0, "", "-"] * "\displaystyle") * FractionText[abs(Slope[expLine])])]) + "(x-" + (LaTeX[((If[randomNum1 ≤ 0, "(", ""] * randomNum1) * If[randomNum1 ≤ 0, ")", ""])]) + ")\\
\bold{" + (LaTeX[If[animSol ≟ 3 ∧ (¬Defined[IndexOf[4, steps]]), (("y=" * If[Slope[expLine] ≟ 0, "", (If[Slope[expLine] ≥ 0, "", "-"] * If[abs(Slope[expLine]) ≟ 1, "x", (("\displaystyle" * FractionText[abs(Slope[expLine])]) * "x")])]) * If[expLine(0) ≟ 0 ∧ Slope[expLine] ≠ 0, "", (If[expLine(0) ≥ 0, "+", "-"] * FractionText[abs(expLine(0))])])]]) + "}"
step4: "\textsf{Traslada la recta }" + (LaTeX[abs(randomNum2)]) + "\textsf{ unidad" + (LaTeX[If[abs(randomNum2) ≟ 1, "", "es"]]) + " hacia " + (LaTeX[If[randomNum2 ≤ 0, "abajo", "arriba"]]) + ":}\\
y=" + (LaTeX[((If[Slope[expLine] ≥ 0, "", "-"] * "\displaystyle") * FractionText[abs(Slope[expLine])])]) + "" + (LaTeX[If[randomNum1 ≟ 0, "x", (("(" * Polynomial[x - randomNum1]) * ")")]]) + "" + (LaTeX[(If[randomNum2 ≤ 0, "", "+"] * randomNum2)]) + "\\ \bold{" + (LaTeX[If[animSol ≟ 4, (("y=" * If[Slope[expLine] ≟ 0, "", (If[Slope[expLine] ≥ 0, "", "-"] * If[abs(Slope[expLine]) ≟ 1, "x", (("\displaystyle" * FractionText[abs(Slope[expLine])]) * "x")])]) * If[expLine(0) ≟ 0 ∧ Slope[expLine] ≠ 0, "", (If[expLine(0) ≥ 0, "+", "-"] * FractionText[abs(expLine(0))])])]]) + "}"
text1 = If(step ≟ 0, "", Element[{step1, step1 + (("\\" * step2)), step3, (If[Defined[IndexOf[3, steps]], (step3 * "\\"), ""] * step4)}, step])
A = Translate((0, 0), Vector[u + v])
text2 = Text(text1, (-27, 2), true, true, 1, -1)
labelX = Text("x", (x(ViewCorner3_{1}) - x(ViewCorner3_{1} - ViewCorner1_{1}) / 35, 0.2), true, true, 0, 1)
inputAsText = Text(InputBox1 + "", false)
sameSol: Defined[IndexOf[Text[x(P1)], inputAsText]] ∧ Defined[IndexOf[Text[y(P1)], inputAsText]]
labelPRight = Text(PRight, PRight, true, true, 0, If[y(PLeft) ≥ y(PRight), -1, 1])
labelPLeft = Text(PLeft, PLeft, true, true, 0, If[y(PLeft) ≥ y(PRight), 1, -1])
correctAnsExplanation_{1}: "\textsf{Tu respuesta puede escribirse así:}\\y=" + (LaTeX[(If[Slope[expLine] ≥ 0, "", "-"] * If[abs(Slope[expLine]) ≟ 1, "", ("\displaystyle" * FractionText[abs(Slope[expLine])])])]) + "(x-" + (LaTeX[((If[x(P1) ≥ 0, "", "("] * x(P1)) * If[x(P1) ≥ 0, "", ")"])]) + ")+" + (LaTeX[((If[y(P1) ≥ 0, "", "("] * y(P1)) * If[y(P1) ≥ 0, "", ")"])]) + "\\
\textsf{Usa los siguientes botones\\para una explicación detallada.}"
labelBtnValidate: "\text{CHEQUEAR (" + (LaTeX[3 - tries]) + ")}"
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correcto}$", "$\text{✕ " + (If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]) + "}$"]]) + ""
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Pista}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
textSolution: "\textsf{\bold{Posible solución}}\\\\
\textsf{Halla la pendiente:}\\\(m=\dfrac{y_{2}-y_{1}}{x_{2}-x_{1}}=\dfrac{" + (LaTeX[y(P2)]) + "-" + (LaTeX[((If[y(P1) ≥ 0, "", "("] * y(P1)) * If[y(P1) ≥ 0, "", ")"])]) + "}{" + (LaTeX[x(P2)]) + "-" + (LaTeX[((If[x(P1) ≥ 0, "", "("] * x(P1)) * If[x(P1) ≥ 0, "", ")"])]) + "}=" + (LaTeX[((If[Slope[expLine] ≥ 0, "", "-"] * "\displaystyle") * FractionText[abs(Slope[expLine])])]) + "\)\\
\\\textsf{Escribe la ecuación:}\\
\(\begin{array}{rcl}y&=&m(x-x_{1})+y_{1}\\y&=&" + (LaTeX[(If[Slope[expLine] ≥ 0, "", "-"] * If[abs(Slope[expLine]) ≟ 1, "", ("\displaystyle" * FractionText[abs(Slope[expLine])])])]) + "(x-" + (LaTeX[((If[x(P1) ≥ 0, "", "("] * x(P1)) * If[x(P1) ≥ 0, "", ")"])]) + ")+" + (LaTeX[((If[y(P1) ≥ 0, "", "("] * y(P1)) * If[y(P1) ≥ 0, "", ")"])]) + "\\y&=&" + (LaTeX[If[Slope[expLine] ≟ 0, "", (If[Slope[expLine] ≥ 0, "", "-"] * If[abs(Slope[expLine]) ≟ 1, "x", (("\displaystyle" * FractionText[abs(Slope[expLine])]) * "x")])]]) + "" + (LaTeX[If[expLine(0) ≟ 0 ∧ Slope[expLine] ≠ 0, "", (If[expLine(0) ≥ 0, "+", "-"] * FractionText[abs(expLine(0))])]]) + "\end{array}\)"
textCountCorrect: "\text{Correctos: " + (LaTeX[countCorrect]) + " }"

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)