#4D4D4D

$\text{Check}$

$\text{NUEVO}$

Fix position and allow selection for all text objects

Reset app

\text{Para calcular la razón de semejanza necesitas datos de ambos triángulos.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{Busca dos lados correspondientes.}

#eeeeee

\text{Halla la razón de semejanza entre estas dos figuras.} 

#2E006758

#2EB00020

bbox2

\text{Arrastra para plantear la razón}

allRandoms = RandomUniform(0, 0.99, 200)
numRandoms: 5
triangleChoices: {{5, 4, 3}, {4, 8, 7}, {6, 5, 3}, {8, 5, 6}, {6, 5, 7}, {6, 7, 3}, {5, 6, 7}, {5, 7, 4}, {8, 5, 6}, {7, 8, 5}}
countQuestion = 0
randIndex: (Mod[countQuestion, floor(Length[allRandoms] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandoms, randIndex, randIndex + numRandoms - 1)
randomOrder = If(countQuestion ≟ 0, 1, 1 + floor((currentRandomSeeds(4) * 2)))
randomScaleStart = Element({2, 3 / 2, 8 / 5, 7 / 5}, If[countQuestion ≟ 0, 1, 1 + floor((currentRandomSeeds(3) * 4))])
randomMult = If(randomScaleStart ≠ 1.2 ∧ randomScaleStart ≠ 1.6 ∧ randomScaleStart ≠ 1.4, (2 * (1 + floor((currentRandomSeeds(2) * 5)))), 5)
randomTriangle = Element(triangleChoices, If[countQuestion ≟ 0, 1, 1 + floor((currentRandomSeeds(1) * Length[triangleChoices]))])
triangle1Sides: ((randomTriangle * randomMult) * If[randomOrder ≟ 1, 1, randomScaleStart])
triangle2Sides: ((randomTriangle * randomMult) * If[randomOrder ≟ 1, randomScaleStart, 1])
topFilled: {NaN, NaN, NaN, NaN, NaN, NaN}
topInd = IndexOf(4, topFilled)
topVal = Element(Flatten[{triangle1Sides, triangle2Sides}], topInd)
bottomFilled: {NaN, NaN, NaN, NaN, NaN, NaN}
tri2Uses = CountIf(n > 0, n, Flatten[{Take[topFilled, 4, 6], Take[bottomFilled, 4, 6]}])
tri1Uses = CountIf(n > 0, n, Flatten[{First[topFilled, 3], First[bottomFilled, 3]}])
isTypicalError: tri1Uses ≟ 2 ∨ tri2Uses ≟ 2
bottomInd = IndexOf(4, bottomFilled)
bottomVal = Element(Flatten[{triangle1Sides, triangle2Sides}], bottomInd)
inputScale: topVal / bottomVal
PointTopFrac: (34.23163, 8.5 + 0.45964)
dragBoxTop = centerBox(2, 2, PointTopFrac)
APoint3 = (3.5666666666666664, 5)
abox3 = centerBox(2, 2, APoint3)
PointBottomFrac: (34.23163, 8.5 - 2.05723)
dragBoxBottom = centerBox(2, 2, PointBottomFrac)
APoint2 = (8.066666666666666, 5)
abox2 = centerBox(2, 2, APoint2)
APoint1 = (6.166666666666666, 1.7999999999999998)
abox1 = centerBox(2, 2, APoint1)
BPoint2 = (20.133333333333333, 5)
bbox2 = centerBox(2, 2, BPoint2)
BPoint1 = (17.333333333333332, 0.6000000000000001)
bbox1 = centerBox(2, 2, BPoint1)
BPoint3 = (13.133333333333333, 5)
CurrentPoints: {(-100, -100), APoint1, APoint2, APoint3, BPoint1, BPoint2, BPoint3}
bbox3 = centerBox(2, 2, BPoint3)
boxNum = 0
CurrentPoint: CurrentPoints(boxNum + 1)
currentBox = centerBox(2, 2, CurrentPoint)
topInts = Zip(IntersectPath[n, dragBoxTop], n, {abox1, abox2, abox3, bbox1, bbox2, bbox3, currentBox})
topArea = If(Defined[Element[topInts, 7]], topInts(7) + 0, 0)
bottomInts = Zip(IntersectPath[n, dragBoxBottom], n, {abox1, abox2, abox3, bbox1, bbox2, bbox3, currentBox})
bottomArea = If(Defined[Element[bottomInts, 7]], bottomInts(7) + 0, 0)
currentPos = IndexOf(Max[{topArea, bottomArea, 0.01}], {topArea, bottomArea, 0.01})
hideSide = Element({1, 3}, 1 + floor((currentRandomSeeds(5) * 2)))
numColors = Remove({1, 2, 3}, {hideSide})
startNum3 = If(Defined[IndexOf[3, numColors]], IndexOf[3, numColors], 0)
randomSide1Start: randomTriangle(1)
widthTris: randomSide1Start + (randomScaleStart * randomSide1Start)
distBetween: (26 - widthTris) / 3
randomSide2Start: randomTriangle(2)
randomSide3Start: randomTriangle(3)
PointA: (0, 0)
PointB: PointA + (randomSide1Start, 0)
circleC2 = Circle(PointB, randomSide2Start)
circleC1 = Circle(PointA, randomSide3Start)
PointC = Intersect(circleC1, circleC2, 1)
triangleStart = Polygon({PointA, PointB, PointC})
triangleDilate = Dilate(triangleStart, randomScaleStart)
totalHeight = Max(y({Vertex[triangleDilate]}))
htriangleDist2: (12 - totalHeight) / 2 - 2
startHeight = Max(y({Vertex[triangleStart]}))
htriangleDist1: (12 - startHeight) / 2 - 2
triangle1vect: (distBetween, If[randomOrder ≟ 1, htriangleDist1, htriangleDist2])
triangle1 = Translate(If[randomOrder ≟ 1, triangleStart, triangleDilate], triangle1vect)
triangle1Corners: {Vertex[triangle1]}
triangle1Mids = Sequence(Midpoint[triangle1Corners(Mod[n - 1, 3] + 1), triangle1Corners(Mod[n, 3] + 1)], n, 1, 3)
Triangle1Mids: {triangle1Mids(1) + (0, -1), triangle1Mids(2) + (1, 1), triangle1Mids(3) + (-1, 1)}
boolMove3a: ¬(APoint3 ∈ {Triangle1Mids(3), PointBottomFrac, PointTopFrac})
hintAnimation = 0 (slider from 0 to 1, step 0.1)
boolMove2a: ¬(APoint2 ∈ {Triangle1Mids(2), PointBottomFrac, PointTopFrac})
startNum2 = If(Defined[IndexOf[2, numColors]], IndexOf[2, numColors], 0)
startNum1 = If(Defined[IndexOf[1, numColors]], IndexOf[1, numColors], 0)
boolMove1a: ¬(APoint1 ∈ {Triangle1Mids(1), PointBottomFrac, PointTopFrac})
randomScale = If(randomOrder ≟ 2, randomScaleStart, 1 / randomScaleStart)
boolIn1aTop: topInts(1) > bottomInts(1) ∨ (¬Defined[bottomInts(1)]) ∧ Defined[topInts(1)]
boolIn2aTop: topInts(2) > bottomInts(2) ∨ (¬Defined[bottomInts(2)]) ∧ Defined[topInts(2)]
boolIn3aTop: topInts(3) > bottomInts(3) ∨ (¬Defined[bottomInts(3)]) ∧ Defined[topInts(3)]
boolIn2aBottom: topInts(2) < bottomInts(2) ∨ Defined[bottomInts(2)] ∧ (¬Defined[topInts(2)])
boolIn3aBottom: topInts(3) < bottomInts(3) ∨ Defined[bottomInts(3)] ∧ (¬Defined[topInts(3)])
boolIn1bBottom: topInts(4) < bottomInts(4) ∨ Defined[bottomInts(4)] ∧ (¬Defined[topInts(4)])
boolIn2bBottom: topInts(5) < bottomInts(5) ∨ Defined[bottomInts(5)] ∧ (¬Defined[topInts(5)])
boolIn3bBottom: topInts(6) < bottomInts(6) ∨ Defined[bottomInts(6)] ∧ (¬Defined[topInts(6)])
boolIn1bTop: topInts(4) > bottomInts(4) ∨ (¬Defined[bottomInts(4)]) ∧ Defined[topInts(4)]
boolIn2bTop: topInts(5) > bottomInts(5) ∨ (¬Defined[bottomInts(5)]) ∧ Defined[topInts(5)]
boolIn3bTop: topInts(6) > bottomInts(6) ∨ (¬Defined[bottomInts(6)]) ∧ Defined[topInts(6)]
boolIn1aBottom: bottomInts(1) > topInts(1) ∨ Defined[bottomInts(1)] ∧ (¬Defined[topInts(1)])
sizeSide3b: "" + (LaTeX[triangle2Sides(3)]) + ""
sizeSide2b: "" + (LaTeX[triangle2Sides(2)]) + ""
sizeSide1b: "" + (LaTeX[triangle2Sides(1)]) + ""
t2Heights: {abs(y(Corner[sizeSide1b, 1]) - y(Corner[sizeSide1b, 3])), abs(y(Corner[sizeSide2b, 1]) - y(Corner[sizeSide2b, 3])), abs(y(Corner[sizeSide3b, 1]) - y(Corner[sizeSide3b, 3]))}
t2Widths: {abs(x(Corner[sizeSide1b, 1]) - x(Corner[sizeSide1b, 3])), abs(x(Corner[sizeSide2b, 1]) - x(Corner[sizeSide2b, 3])), abs(x(Corner[sizeSide3b, 1]) - x(Corner[sizeSide3b, 3]))}
PointSize: (0, 1)
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
correct: (inputScale ≟ 1 / randomScaleStart ∨ inputScale ≟ randomScaleStart) ∧ (¬isTypicalError)
showbuttons = true
showhinttypicalerror = false
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16 + 36 + 24 + 16 + 8
pixelsTop: 24 + 16 + 8
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: 95 + 24 + 24 + 24 + 24
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 568
layoutAppSize = Corner(5)
inputSaved: {NaN, NaN, 0, 0}
inputCurrent: {topVal, bottomVal, tri1Uses, tri2Uses}
enableBtnValidate: Defined[inputCurrent(1)] ∧ Defined[inputCurrent(2)] ∧ inputCurrent ≠ inputSaved
triangle2vect: (If[randomOrder ≟ 1, randomSide1Start + (2 * distBetween), (randomSide1Start * randomScaleStart) + (2 * distBetween)], If[randomOrder ≟ 1, htriangleDist2, htriangleDist1])
triangle2 = Translate(If[randomOrder ≟ 1, triangleDilate, triangleStart], triangle2vect)
sizeSide1a: "" + (LaTeX[triangle1Sides(1)]) + ""
sizeSide2a: "" + (LaTeX[triangle1Sides(2)]) + ""
sizeSide3a: "" + (LaTeX[triangle1Sides(3)]) + ""
PointCorners = Zip(Corner[n, 4], n, {sizeSide1a, sizeSide2a, sizeSide3a, sizeSide1b, sizeSide2b, sizeSide3b})
positionVect = Zip(n - PointSize, n, PointCorners)
triangle2Corners: {Vertex[triangle2]}
triangle2Mids = Sequence(Midpoint[triangle2Corners(Mod[n - 1, 3] + 1), triangle2Corners(Mod[n, 3] + 1)], n, 1, 3)
t1Widths: {abs(x(Corner[sizeSide1a, 1]) - x(Corner[sizeSide1a, 3])), abs(x(Corner[sizeSide2a, 1]) - x(Corner[sizeSide2a, 3])), abs(x(Corner[sizeSide3a, 1]) - x(Corner[sizeSide3a, 3]))}
t1Heights: {abs(y(Corner[sizeSide1a, 1]) - y(Corner[sizeSide1a, 3])), abs(y(Corner[sizeSide2a, 1]) - y(Corner[sizeSide2a, 3])), abs(y(Corner[sizeSide3a, 1]) - y(Corner[sizeSide3a, 3]))}
Point1Texts = Zip(n + (((-k)) / 2, m / 2) - f, n, {APoint1, APoint2, APoint3}, k, t1Widths, m, t1Heights, f, First[positionVect, 3])
Point2Texts = Zip(n + (((-k)) / 2, m / 2) - f, n, {BPoint1, BPoint2, BPoint3}, k, t2Widths, m, t2Heights, f, Last[positionVect, 3])
textSide1b: "" + (LaTeX[sizeSide1b]) + ""
textSide2a: "" + (LaTeX[sizeSide2a]) + ""
textSide2b: "" + (LaTeX[sizeSide2b]) + ""
textSide3a: "" + (LaTeX[sizeSide3a]) + ""
textSide3b: "" + (LaTeX[sizeSide3b]) + ""
textSide1a: "" + (LaTeX[sizeSide1a]) + ""
borderRect = Polygon({(0, -2), (26, -2), (26, 10), (0, 10)})
Triangle2Mids: {triangle2Mids(1) + (0, -1), triangle2Mids(2) + (1, 1), triangle2Mids(3) + (-1, 1)}
dimensions: {-0.694550599312075, -11.117812737305814, 38.85234857842027, 13.627474300571286}
boxMoving = 5
boolMove1b: ¬(BPoint1 ∈ {Triangle2Mids(1), PointBottomFrac, PointTopFrac})
boolMove2b: ¬(BPoint2 ∈ {Triangle2Mids(2), PointBottomFrac, PointTopFrac})
boolMove3b: ¬(BPoint3 ∈ {Triangle2Mids(3), PointBottomFrac, PointTopFrac})
dragBoxTopHighlight: dragBoxTop
dragBoxBottomHighlight: dragBoxBottom
topHover: currentPos ≟ 1
bottomHover: currentPos ≟ 2
continueFrac: "= " + (LaTeX[FractionText[topVal / bottomVal]]) + ""
Point1StaticTexts = Zip(n + (((-k)) / 2, m / 2) - f, n, Triangle1Mids, k, t1Widths, m, t1Heights, f, First[positionVect, 3])
Point2StaticTexts = Zip(n + (((-k)) / 2, m / 2) - f, n, Triangle2Mids, k, t2Widths, m, t2Heights, f, Last[positionVect, 3])
text1aStatic: "" + (LaTeX[sizeSide1a]) + ""
text2aStatic: "" + (LaTeX[sizeSide2a]) + ""
text3aStatic: "" + (LaTeX[sizeSide3a]) + ""
text1bStatic: "" + (LaTeX[sizeSide1b]) + ""
text2bStatic: "" + (LaTeX[sizeSide2b]) + ""
text3bStatic: "" + (LaTeX[sizeSide3b]) + ""
angle1a = Angle(triangle1Corners(3), triangle1Corners(2), triangle1Corners(1))
angle2a = Angle(triangle1Corners(1), triangle1Corners(3), triangle1Corners(2))
angle3a = Angle(triangle1Corners(2), triangle1Corners(1), triangle1Corners(3))
angle2b = Angle(triangle2Corners(1), triangle2Corners(3), triangle2Corners(2))
angle3b = Angle(triangle2Corners(2), triangle2Corners(1), triangle2Corners(3))
angle1b = Angle(triangle2Corners(3), triangle2Corners(2), triangle2Corners(1))
side1a = Segment(triangle1Corners(1), triangle1Corners(2))
side2a = Segment(triangle1Corners(2), triangle1Corners(3))
side3a = Segment(triangle1Corners(3), triangle1Corners(1))
side1b = Segment(triangle2Corners(1), triangle2Corners(2))
side2b = Segment(triangle2Corners(2), triangle2Corners(3))
side3b = Segment(triangle2Corners(3), triangle2Corners(1))
box1aColor: {If[boolMove1a, 226, (startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 245, showanswer ∨ showsolution, 202, 238] / 255, If[boolMove1a, 223, (startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 224, showanswer ∨ showsolution, 213, 238] / 255, If[boolMove1a, 248, (startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 210, showanswer ∨ showsolution, 237, 238] / 255}
box1bColor: {If[boolMove1b, 226, (startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 245, showanswer ∨ showsolution, 202, 238] / 255, If[boolMove1b, 223, (startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 224, showanswer ∨ showsolution, 213, 238] / 255, If[boolMove1b, 248, (startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 210, showanswer ∨ showsolution, 237, 238] / 255}
box2aColor: {If[boolMove2a, 226, (startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 245, showanswer ∨ showsolution, 241, 238] / 255, If[boolMove2a, 223, (startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 224, showanswer ∨ showsolution, 210, 238] / 255, If[boolMove2a, 248, (startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 210, showanswer ∨ showsolution, 216, 238] / 255}
box2bColor: {If[boolMove2b, 226, (startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 245, showanswer ∨ showsolution, 241, 238] / 255, If[boolMove2b, 223, (startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 224, showanswer ∨ showsolution, 210, 238] / 255, If[boolMove2b, 248, (startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 210, showanswer ∨ showsolution, 216, 238] / 255}
box3aColor: {If[boolMove3a, 226, (startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 245, showanswer ∨ showsolution, 210, 238] / 255, If[boolMove3a, 223, (startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 224, showanswer ∨ showsolution, 228, 238] / 255, If[boolMove3a, 248, (startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 210, showanswer ∨ showsolution, 226, 238] / 255}
box3bColor: {If[boolMove3b, 226, (startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 245, showanswer ∨ showsolution, 210, 238] / 255, If[boolMove3b, 223, (startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 224, showanswer ∨ showsolution, 228, 238] / 255, If[boolMove3b, 248, (startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 210, showanswer ∨ showsolution, 226, 238] / 255}
text1Color: {If[(startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 199, showanswer ∨ showsolution, 58, 148] / 255, If[(startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 80, showanswer ∨ showsolution, 110, 148] / 255, If[(startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 0, showanswer ∨ showsolution, 214, 148] / 255}
text2Color: {If[(startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 199, showanswer ∨ showsolution, 218, 148] / 255, If[(startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 80, showanswer ∨ showsolution, 37, 148] / 255, If[(startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 0, showanswer ∨ showsolution, 112, 148] / 255}
text3Color: {If[(startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 199, showanswer ∨ showsolution, 15, 148] / 255, If[(startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 80, showanswer ∨ showsolution, 133, 148] / 255, If[(startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 0, showanswer ∨ showsolution, 56, 148] / 255}
text1BColor: {If[(startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 199, showanswer ∨ showsolution, 58, 37] / 255, If[(startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 80, showanswer ∨ showsolution, 110, 37] / 255, If[(startNum1 - 1) / 2 < hintAnimation < startNum1 / 2, 0, showanswer ∨ showsolution, 214, 37] / 255}
text2BColor: {If[(startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 199, showanswer ∨ showsolution, 218, 37] / 255, If[(startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 80, 37] / 255, If[(startNum2 - 1) / 2 < hintAnimation < startNum2 / 2, 0, showanswer ∨ showsolution, 112, 37] / 255}
text3BColor: {If[(startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 199, showanswer ∨ showsolution, 15, 37] / 255, If[(startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 80, showanswer ∨ showsolution, 133, 37] / 255, If[(startNum3 - 1) / 2 < hintAnimation < startNum3 / 2, 0, showanswer ∨ showsolution, 56, 37] / 255}
speed: 1.5
boolMoving: true ∈ {boolMove1a, boolMove1b, boolMove2a, boolMove2b, boolMove3a, boolMove3b}
textNums: {"0", textSide1a, textSide2a, textSide3a, textSide1b, textSide2b, textSide3b}
currentText: "" + (LaTeX[textNums(boxNum + 1)]) + ""
TextPoint = Element(Flatten[{(-100, -100), Point1Texts, Point2Texts}], boxNum + 1)
angleB1a = Angle(triangle1Corners(3), triangle1Corners(2), triangle1Corners(1))
angleB1b = Angle(triangle2Corners(3), triangle2Corners(2), triangle2Corners(1))
angleB2a = Angle(triangle1Corners(1), triangle1Corners(3), triangle1Corners(2))
angleB2b = Angle(triangle2Corners(1), triangle2Corners(3), triangle2Corners(2))
angleB3a = Angle(triangle1Corners(2), triangle1Corners(1), triangle1Corners(3))
angleB3b = Angle(triangle2Corners(2), triangle2Corners(1), triangle2Corners(3))
bottomFill = Zip(Defined[n], n, First[bottomFilled, 6])
topFill = Zip(Defined[n], n, First[topFilled, 6])
inBottom: true ∈ Zip[bottomFill(n), n, {1, 2, 3, 4, 5, 6} \ {boxNum}]
inTop: true ∈ Zip[topFill(n), n, {1, 2, 3, 4, 5, 6} \ {boxNum}]
fractionBar = Segment(Midpoint[PointTopFrac, PointBottomFrac] - (1.1, 0), Midpoint[PointTopFrac, PointBottomFrac] + (1.1, 0))
onboarding = true
pulsingSpeed: 8
pulsing = 0.2 (slider from 0 to 1, step 0.1)
StartOnboard1 = PointToPixels(Corner[1], Corner[3], Corner[5], BPoint2 + (-0.5, 3.5))
onboardingX: x(StartOnboard1)
onboardingY: 500 - y(StartOnboard1) + 40
onboardingCase: 2
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
pulsingObject = expandQuad(BPoint2 + (1, 1), BPoint2 + (-1, 1), BPoint2 + (-1, -1), BPoint2 + (1, -1), (7 * pulsing), Corner[1], Corner[3], Corner[5])
StartOnboard2 = PointToPixels(Corner[1], Corner[3], Corner[5], PointTopFrac + (-2.5, -0.5))
onboardingX2: x(StartOnboard2)
onboardingY2: 500 - y(StartOnboard2)
onboardingDisplayText: "\bgcolor{white}{" + (LaTeX[onboardingText]) + "}"
labelBtnValidate: "\text{CHEQUEAR (" + (LaTeX[3 - tries]) + ")}"
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Pista}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + "}"
textCountCorrect: "\text{Correctos: " + (LaTeX[countCorrect]) + " }"
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correcto}$", "$\text{✕ " + (If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]) + "}$"]]) + ""
textSolution: "\textsf{\bold{Posible solución}}\\
\textsf{La razón de semejanza entre dos figuras es la razón entre dos segmentos correspondientes.\\
En este caso: \[\dfrac{\textcolor{" + (LaTeX[colorBlue]) + "}{ " + (LaTeX[triangle1Sides(1)]) + "}}{\textcolor{" + (LaTeX[colorBlue]) + "}{" + (LaTeX[triangle2Sides(1)]) + "}}=\dfrac{\textcolor{" + (LaTeX[colorPink]) + "}{" + (LaTeX[triangle1Sides(2)]) + "}}{\textcolor{" + (LaTeX[colorPink]) + "}{" + (LaTeX[triangle2Sides(2)]) + "}}=\dfrac{\textcolor{" + (LaTeX[colorGreen]) + "}{" + (LaTeX[triangle1Sides(3)]) + "}}{\textcolor{" + (LaTeX[colorGreen]) + "}{" + (LaTeX[triangle2Sides(3)]) + "}}=" + (LaTeX[FractionText[randomScale]]) + "\]"
textScale_{1}: "\text{Razón de semejanza: \[\phantom{\dfrac{\phantom{10000}}{\phantom{10000}}} " + (LaTeX[If[Defined[topVal] ∧ Defined[bottomVal], continueFrac + "", ""]]) + "\]}"
textAnswer: "\text{La razón de \\semejanza es \[" + (LaTeX[FractionText[randomScale]]) + "\].}"

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: centerBox
centerBox(width,height,centerPoint)
Input: boxWidth, boxHeight, PCenter
Output: BoxText1

vOffset: (((-boxWidth)) / 2, ((-boxHeight)) / 2)
PCorner1: PCenter + vOffset
PCorner2: PCorner1 + (boxWidth, 0)
PointText3: PCorner2 + (0, boxHeight)
PointText4: PCorner1 + (0, boxHeight)
BoxText1 = Polygon({PCorner1, PCorner2, PointText3, PointText4})

Tool: expandQuad
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, 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, D}
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)