#4D4D4D

$\text{Check}$

$\text{NUEVO}$

Fix position and allow selection for all text objects

Reset app

\textsf{Revisa los signos.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

\text{Move to start}

$\math{y=}$

\text{Halla la constante de proporcionalidad\para los pares ordenados graficados.} 

x

$\bold{\bgcolor{white}{%v}}$

$\bold{\bgcolor{white}{%v}}$

$\bold{\bgcolor{white}{%v}}$

$\bold{\bgcolor{white}{%v}}$

x

y

randomSequence = Shuffle(Sequence[1, 100])
allRandomSeeds = RandomUniform(0, 0.99, 200)
countQuestion = 0
numRandoms: 3
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
randSlopeNum: 1 + floor((currentRandomSeeds(3) * 5))
randSign: 1 + floor((currentRandomSeeds(2) * 2))
randomSlope: (If[randSign ≟ 1, 1, -1] * randSlopeNum)
questionLine(x) = (randomSlope * x)
PointsLine = Sequence((n, questionLine(n)), n, -11, 11)
PointsLineFiltered = KeepIf(-11 < y(n) ≤ 0 ∨ x(n) ≤ 8 ∧ y(n) > -11 ∧ y(n) < 11, n, PointsLine)
randomSequenceFiltered = KeepIf(n ≤ Length[PointsLineFiltered], n, randomSequence)
sequenceUse = If(Length[randomSequenceFiltered] > 4, First[randomSequenceFiltered, 4], randomSequenceFiltered)
PointsUse = Sequence(PointsLineFiltered(sequenceUse(n)), n, 1, 4)
xPoints: x(PointsUse)
xPointsPositive = KeepIf(n ≥ 0, n, xPoints)
xPointsNegative = KeepIf(n < 0, n, xPoints)
input1 = NaN
UserPoints = Zip((n, (input1 * n)), n, Flatten[{Sort[xPointsPositive], Reverse[Sort[xPointsNegative]]}])
UserPointsSorted = Sort(UserPoints)
hintLine(x) = (input1 * x)
hintLineIntersect = If(Defined[input1], hintLine, questionLine)
viewbox = Polygon({(-11.5, -11.5), (-11.5, 11.5), (11.5, 11.5), (11.5, -11.5)})
xPointsProblem = Sort(x(PointsUse))
yPointsProblem: (xPointsProblem * randomSlope)
onboarding = false
inputSaved: {NaN}
inputCurrent: {input1}
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
correct: input1 ≟ randomSlope
showbuttons = true
showhinttypicalerror = false
helpTextHint: "\textsf{Revisa si tu respuesta\\satisface la ecuación.}\\
\[\begin{array}{rcccl}" + (LaTeX[yPointsProblem(1)]) + " &=& \bold\color{" + (LaTeX[colorOrange]) + "}{\phantom{0}?\phantom{0}} &\times&" + (LaTeX[xPointsProblem(1)]) + "\\" + (LaTeX[yPointsProblem(2)]) + "&=& \bold\color{" + (LaTeX[colorOrange]) + "}{\phantom{0}?\phantom{0}} &\times&" + (LaTeX[xPointsProblem(2)]) + "\\" + (LaTeX[yPointsProblem(3)]) + "&=& \bold\color{" + (LaTeX[colorOrange]) + "}{\phantom{0}?\phantom{0}} &\times&" + (LaTeX[xPointsProblem(3)]) + "\\" + (LaTeX[yPointsProblem(4)]) + "&=& \bold\color{" + (LaTeX[colorOrange]) + "}{\phantom{0}?\phantom{0}} &\times&" + (LaTeX[xPointsProblem(4)]) + "
\end{array}\]"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16 + 36 + 24 + 16 + 8
pixelsTop: 24 + 16 + 8
layoutY: 96 + 42 + 24
layoutX: 465
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ (¬onboarding) ∧ Defined[input1]
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correcto}$", "$\text{✕ " + (If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]) + "}$"]]) + ""
pulsing = 0.3 (slider from 0 to 1, step 0.1)
pulsingSpeed: 8
haloPixels: (pulsing * 7)
pulseColor: (37 + (pulsing * 218)) / 255
onboardingCase: 2
onboardingX: 275 + 25
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
InputBox1 = Textfield(input1)
dimensions: {-12.166104793800774, -14.85565566520364, 31.24507326522386, 13.516927109896566}
Point1: PointsUse(1)
Point2: PointsUse(2)
Point3: PointsUse(3)
Point4: PointsUse(4)
animationSlider = 0 (slider from 0 to animationLSorted, step 0.01)
speed: 2
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Pista}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + ""
hintLines: {}
HintInts1: {Intersect[hintLineIntersect, viewbox]}
xMinHint = Min(x(HintInts1))
xMaxHint = Max(x(HintInts1))
UserPointsPositive = Zip((n, (input1 * n)), n, Flatten[{0, Sort[xPointsPositive], xMaxHint}])
UserPointsNegative = Zip((n, (input1 * n)), n, Flatten[{0, Reverse[Sort[xPointsNegative]], xMinHint}])
animationLSorted = Length(UserPointsSorted)
animationLNegative = Length(UserPointsNegative)
animationLength: animationLSorted + animationLNegative
minP = If(animationSlider < 2, 0, 2)
maxP = If(animationSlider < 2, 0, animationSlider ≤ animationLSorted - 1, floor(animationSlider), animationLSorted - 1)
minN = If(animationSlider < animationLSorted + 2, 0, 2)
maxN = If(animationSlider < animationLSorted + 2, 0, animationSlider ≤ animationLength - 1, floor(animationSlider) - animationLSorted, animationLNegative - 1)
animationPValue = If(animationSlider < animationLSorted, animationSlider, animationLSorted)
animationNValue = If(animationSlider ≤ animationLSorted, 0, animationSlider - animationLSorted)
AnimationPoint1 = PartitionPoint((xMinHint, hintLine(xMinHint)), (xMaxHint, hintLine(xMaxHint)), animationSlider, animationLSorted)
AnimationPoint2 = PartitionPoint((xMinHint, hintLine(xMinHint)), (xMaxHint, hintLine(xMaxHint)), animationSlider, animationLSorted)
textSolution: "\textsf{\bold{Posible solución}}\\
\textsf{Encuentra un factor que funcione \\
para todos los casos.}\\
\[\begin{array}{rcccl}
 " + (LaTeX[yPointsProblem(1)]) + " &=& \bold{" + (LaTeX[randomSlope]) + "} &\times& " + (LaTeX[xPointsProblem(1)]) + "\\ " + (LaTeX[yPointsProblem(2)]) + "&=& \bold{" + (LaTeX[randomSlope]) + "} &\times&" + (LaTeX[xPointsProblem(2)]) + " \\ " + (LaTeX[yPointsProblem(3)]) + "&=& \bold{" + (LaTeX[randomSlope]) + "} &\times&" + (LaTeX[xPointsProblem(3)]) + " \\ " + (LaTeX[yPointsProblem(4)]) + "&=& \bold{" + (LaTeX[randomSlope]) + "} &\times&" + (LaTeX[xPointsProblem(4)]) + " 
\end{array}\]\\
\textsf{Por lo tanto, la ecuación es }y=" + (LaTeX[randomSlope]) + "x."
isTypicalError: input1 ≟ (-randomSlope)
axisX = Segment((-11.5, 0), (11.5, 0))
axisY = Segment((0, -11.5), (0, 11.5))
tabOrder: {textQuestion, InputBox1, btnValidate, textFeedback, textHint, textSolution, btnNew}
segmentAnimation1 = Segment((xMinHint, hintLine(xMinHint)), AnimationPoint1)
enableInput: tries < 3 ∧ (¬(validate ∧ correct)) ∧ (animationSlider ≟ animationLSorted ∨ animationSlider ≟ 0)
segmentAnimation2 = Segment((xMinHint, hintLine(xMinHint)), AnimationPoint1)
HintPointsPositive = KeepIf(validate ∧ x(n) ≤ x(AnimationPoint2) ∧ x(n) ∈ xPoints ∧ -11.5 ≤ y(n) ≤ 11.5 ∧ -11.5 ≤ x(n) ≤ 11.5, n, UserPointsSorted)
labelBtnValidate: "\text{CHEQUEAR (" + (LaTeX[3 - tries]) + ")}"
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: expandTriangle
expandTriangle(A,B,C,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, 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}
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: 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: PartitionPoint
PartitionPoint(P1,P2,Num,Den)
Input: SimMove, solutionPoint, animation1Slider, animation1Range
Output: Animation1Point

$\textbf{\mathsf{F}}$

Animation1Point: SimMove + (animation1Slider * (solutionPoint - SimMove) / animation1Range)