3

Element(randomCase, Mod(countQuestion, Length(randomCase)) + 1)

El ángulo que nombraste no es el que se muestra.

#4D4D4D

$\text{NUEVO}$

Fix position and allow selection for all text objects

Empty all input boxes

\text{This is the answer.}

Reset app

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\textsf{Presiona los botones de opción para animar posibles nombres del ángulo.}

#eeeeee

#2E006758

#2EB00020

\text{Arrastra para nombrar el ángulo}

\textsf{Make sure you use the correct inequality symbol.}

\textsf{Be sure to multiply }x\textsf{ by the rate.}

\textsf{Be sure to check your constant.}

\text{Resuelve la inecuación.}

used in btnOrganize script to record whether the moved item is already in the destination.

\text{Nombra el ángulo que está dibujado.}

Coloca el símbolo de ángulo al inicio.

Dos puntos no permiten identificar un ángulo.

El ángulo que nombraste no es el que se muestra.

$\text{OPCIÓN 1}$

$\text{OPCIÓN 2}$

$\text{OPCIÓN 3}$

animateControl > 0 ∧ displayCase ≟ 1 ∨ animateControl ≟ 2 ∧ displayCase ≟ 2

randomSeeds = RandomUniform(0, 0.99, 100)
randomCase = Shuffle(Sequence[6])
currentCorrect = false
namesFound: {}
destinationOrder: {}
inputCurrent: destinationOrder
numRandoms: 4
countQuestion = 0
indexLetter: 1 + floor((randomSeeds(Mod[(numRandoms * countQuestion), Length[randomSeeds]] + 1) * 3))
letterSet = Element({{"A", "B", "C"}, {"L", "M", "N"}, {"X", "Y", "Z"}}, indexLetter)
foundList = Sequence((("\angle " * letterSet(namesFound(A, 2))) * If[Length[namesFound(A)] > 2, (letterSet(namesFound(A, 3)) * letterSet(namesFound(A, 4))), ""]), A, 1, Length[namesFound])
caseNum = Element(randomCase, Mod[countQuestion, Length[randomCase]] + 1)
animateControl = 2 (slider from 0 to 2)
armLength: 2.5
AnchorFigure = (8.324, 5.5588)
indexRotation: 1 + floor((randomSeeds(Mod[(numRandoms * countQuestion) + 3, Length[randomSeeds]] + 1) * 6))
rotationAngle = Element({pi / 2, pi / 3, pi / 4, (3 * pi / 5), (2 * pi / 5), (2 * pi / 3), pi / 6, (5 * pi / 6)}, indexRotation)
PtB = Rotate(AnchorFigure + (armLength, 0), rotationAngle, AnchorFigure)
indexAngle: 1 + floor((randomSeeds(Mod[(numRandoms * countQuestion) + 2, Length[randomSeeds]] + 1) * 6))
currentAngle = Element({pi / 2, pi / 3, pi / 4, (3 * pi / 5), (2 * pi / 5), (2 * pi / 3), pi / 6, (5 * pi / 6)}, indexAngle)
PtA = Rotate(AnchorFigure + (armLength, 0), rotationAngle + currentAngle, AnchorFigure)
displayCase = 4
displayPointsActual = Element({{PtA, AnchorFigure, AnchorFigure, PtB}, {PtB, AnchorFigure, AnchorFigure, PtA}, {AnchorFigure, PtA, AnchorFigure, PtB}}, displayCase)
caseMap = Element({{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}}, caseNum)
PointStudentCenter = If(Length[destinationOrder] ≟ 2, IndexOf[destinationOrder(2), caseMap], IndexOf[destinationOrder(3), caseMap])
PointStudentFirst = If(Length[destinationOrder] ≟ 2, Mod[PointStudentCenter, 3] + 1, IndexOf[destinationOrder(2), caseMap])
PointStudentThird = Element(Remove[{1, 2, 3}, {PointStudentCenter, PointStudentFirst}], 1)
displayOrderStudent = Element({{PointStudentCenter, PointStudentFirst, PointStudentCenter, PointStudentThird}, {PointStudentFirst, PointStudentCenter, PointStudentFirst, PointStudentCenter}, {PointStudentFirst, PointStudentCenter, PointStudentCenter, PointStudentThird}}, Length[destinationOrder] - 1)
displayPointsStudent = Zip(Element[{PtA, AnchorFigure, PtB}, A], A, displayOrderStudent)
displayPointsAnimate = If(displayCase ≟ 4, displayPointsStudent, displayPointsActual)
showFinalLabel: displayPointsAnimate(1) ≠ displayPointsAnimate(3) ∨ displayPointsAnimate(2) ≟ displayPointsAnimate(4)
studentPoints = Zip(Element[{PtA, AnchorFigure, PtB}, B], B, {PointStudentFirst, PointStudentCenter, PointStudentThird})
showsolution = false
correct: Length[namesFound] ≟ 3
correctLength: Length[destinationOrder] ≟ 2 ∨ Length[destinationOrder] ≟ 4
correctSymbol: destinationOrder(1) ≟ 4
boxHeight: 1
step = 1
HomeAnchor = (-6.3412, 7.5674)
movingIndex = NaN
destinationSize: 6
P1 = (-6.1411999999999995, 7.5674)
P2 = (-4.9412, 7.5674)
P3 = (-3.7411999999999996, 7.5674)
P4 = (-2.5412, 7.5674)
movingPoints: {P1, P2, P3, P4}
PMove = Element(movingPoints, movingIndex)
boxWidth: boxHeight
seedIndex: Mod[(3 * countQuestion), Length[randomSeeds] - 3] + 1
seed1: randomSeeds(seedIndex)
seed3: randomSeeds(seedIndex + 2)
seed2: randomSeeds(seedIndex + 1)
widths: {boxWidth, boxWidth, boxWidth, boxWidth}
box4 = centerBox(widths(4), boxHeight, P4)
box3 = centerBox(widths(3), boxHeight, P3)
box2 = centerBox(widths(2), boxHeight, P2)
box1 = centerBox(widths(1), boxHeight, P1)
homeOffsets = Sequence(If[A ≟ 1, 0, boxWidth], A, 1, 4)
DestinationAnchor = (-6.6074, 6.0428)
destinationOffsets = Sequence(If[A ≟ 1, boxWidth / 2, boxWidth], A, 1, Length[destinationOrder])
destinationBoxWidth: (boxWidth * 4)
CenterDestination: DestinationAnchor + (destinationBoxWidth / 2, 0)
allText = Append(letterSet, "\angle")
studentEqn: ("" * Sum[Zip[If[A ≟ 9 ∨ A ≟ 10, "=", allText(A)], A, destinationOrder]])
homeLocations = Sequence(HomeAnchor + (Sum[Take[homeOffsets, 1, A]] + (A * 0.2), 0), A, 1, 4)
OnboardingStart = PointToPixels(Corner[1], Corner[3], Corner[5], homeLocations(10) + (1, -0.3))
FRAME: 1
HOME: -1
frameAnswer = centerBox(destinationBoxWidth, boxHeight, CenterDestination)
studentAns = NaN
currentLocations: {1, 2, -1, 3}
onboarding = true
inputSaved: {}
input2 = NaN
input1: NaN
validate = false
showanswer = false
duplicateName: Defined[IndexOf[inputCurrent, namesFound]] ∧ (¬currentCorrect)
tries = 0
countCorrect = 0
showhint = false
showbuttons = true
helpTextHintTypicalError: "\textsf{" + (LaTeX[currentHint]) + "}"
showhinttypicalerror = false
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
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: 200
layoutX: 16
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent] ∧ (step ≟ 2 ∨ (¬Defined[IndexOf[-1, inputCurrent]])) ∧ (¬onboarding)
pulsingSpeed: 8
pulsing = 0.2 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
onboardingCase: 1
onboardingX = 224
onboardingY = 85
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
useOnboarding: true
layoutCase: 1
layoutHintSolnY: layoutY + Element[{56, 88}, layoutCase]
layoutHintSolnX = Element({If[layoutX ≟ 16, layoutX - 5, 11], layoutX - 5}, layoutCase)
layoutFeedbackX: layoutX + 135
layoutFeedbackY = If(step ≟ 1 ∨ step ≟ 2 ∧ (¬showsolution), layoutY + 5, layoutY - 50)
organizing = false
locationPMove = If(IsInRegion[PMove, frameAnswer], FRAME, HOME)
highlightBox = centerBox(widths(movingIndex), boxHeight, PMove)
allHome = Zip(HOME, A, movingPoints)
PTemp = (-2.0970947907731237, 3.706197659203899)
tmpIndex = NaN
captionStep2: "\(x" + (LaTeX[If[displayCase ≥ 6, "\ge", "\le"]]) + "\)"
inDestination = Defined(IndexOf[movingIndex, destinationOrder])
textHighlight = If(Defined[movingIndex], Text[allText(movingIndex), PMove, true, true, 0, 0], "")
boxWidthSmall: boxWidth / 2
destinationAnchors = Sequence(DestinationAnchor + (Sum[Take[destinationOffsets, 1, A]], 0), A, 1, Length[destinationOffsets])
studentInequality: ("" * Sum[Zip[allText(A), A, destinationOrder]])
inBox = false
boxText = Zip(Text[("\vphantom{\dfrac{1}{2}}\hspace{7px}" * If[step ≟ 2 ∧ (¬Defined[IndexOf[C, destinationOrder]]), "", ("" * A)]), B, true, true, 0, 0], A, allText, B, movingPoints, C, {1, 2, 3, 4})
displayOrder = Sequence(letterSet(caseMap(i)), i, 1, 3)
correctOrder: {Append[4, caseMap], Append[4, Reverse[caseMap]], {4, caseMap(2)}}
angleInterior = Angle(PtB, AnchorFigure, PtA)
rayB = Segment(AnchorFigure, PtB)
rayA = Segment(AnchorFigure, PtA)
correctName: Defined[IndexOf[inputCurrent, correctOrder]] ∧ (¬Defined[IndexOf[inputCurrent, namesFound]])
pointsThisTurn: (Length[foundList] * 2)
totalPoints = 0
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
overlapBox = RemoveUndefined(Zip[If[IsInRegion[PMove, A] ∧ B ≠ movingIndex, B], A, {box1, box2, box3, box4}, B, {1, 2, 3, 4}])
highlightFrame = If(Length[overlapBox] ≟ 1, Element[{box1, box2, box3, box4}, overlapBox(1)], centerBox[destinationBoxWidth, boxHeight, CenterDestination])
allBoxes = Zip(centerBox[boxWidth, boxHeight, B], B, movingPoints)
cmdFixBoxes = Sequence((("SetFixed(box" * A) * ",false,enableInput)"), A, 1, 4)
cmdOrganizeHome = RemoveUndefined(Sequence[If[¬Defined[IndexOf[A, destinationOrder]], (((("SetValue(P" * A) * ",homeLocations(") * A) * "))")], A, 1, 4])
cmdSendHome = Sequence((((("SetValue(P" * A) * ",homeLocations(") * A) * "))"), A, 1, 4)
cmdOrganizeDestination = Sequence((((("SetValue(P" * destinationOrder(A)) * ",destinationAnchors(") * A) * "))"), A, 1, Length[destinationOrder])
lblAnchor = Text(("" * letterSet(correctOrder(1, 3))), Midpoint[PtA, PtB] + (1.2 * (AnchorFigure - Midpoint[PtA, PtB])), true, true, 0, 0)
animate1 = If(displayPointsAnimate(1) ≠ displayPointsAnimate(3), If[animateControl < 1, animateControl, 1], animateControl / 2)
speed: 5
animate2 = If(displayPointsAnimate(1) ≠ displayPointsAnimate(3), If[animateControl < 1, 0, animateControl - 1], animateControl / 2)
animateBranch1A = Segment(displayPointsAnimate(1), displayPointsAnimate(1) + (animate1 * (displayPointsAnimate(2) - displayPointsAnimate(1))))
animateBranch1B = Segment(displayPointsAnimate(3), displayPointsAnimate(3) + (animate2 * (displayPointsAnimate(4) - displayPointsAnimate(3))))
numCorrect = Length(namesFound)
showDiagram: animateControl ≟ 0
coverBox = centerBox(7, 7, AnchorFigure)
llayoutY: 180
studentAngle = If(Angle[studentPoints(1), studentPoints(2), studentPoints(3)] > pi, Angle[studentPoints(3), studentPoints(2), studentPoints(1)], Angle[studentPoints(1), studentPoints(2), studentPoints(3)])
captionCase1: "\text{\(\angle " + (LaTeX[((displayOrder(1) * displayOrder(2)) * displayOrder(3))]) + "\)}"
captionCase2: "\(\angle " + (LaTeX[((displayOrder(3) * displayOrder(2)) * displayOrder(1))]) + "\)"
captionCase3: "\text{\(\angle " + (LaTeX[displayOrder(2)]) + "\)}"
angleSoln = Angle(PtB, AnchorFigure, PtA)
lblA = Text(("" * letterSet(correctOrder(1, 2))), AnchorFigure + (1.2 * (PtA - AnchorFigure)), true, true, 0, 0)
lblB = Text(("" * letterSet(correctOrder(1, 4))), AnchorFigure + (1.2 * (PtB - AnchorFigure)), true, true, 0, 0)
animatePoints = Zip(displayOrder(IndexOf[A, {PtA, AnchorFigure, PtB}]), A, {displayPointsAnimate(1), displayPointsAnimate(2), displayPointsAnimate(4)})
lblAnimateFirst = Text(("" * displayOrder(1)), AnchorFigure + (1.2 * (PtA - AnchorFigure)), true, true, 0, 0)
lblAnimateSecond = Text(("" * displayOrder(2)), Midpoint[PtA, PtB] + (1.2 * (AnchorFigure - Midpoint[PtA, PtB])), true, true, 0, 0)
lblAnimateThird = Text(("" * displayOrder(3)), AnchorFigure + (1.2 * (PtB - AnchorFigure)), true, true, 0, 0)
showStudent = Sequence(animateControl ≥ Element[{0.1, 1, 2}, A] ∧ studentPoints(Element[{1, 2, 4}, A]) ≟ Element[{PtA, AnchorFigure, PtB}, A], A, 1, 3)
showFirst: animateControl > 0 ∧ displayPointsAnimate(1) ≟ PtA ∨ animateControl ≥ 1 ∧ displayPointsAnimate(2) ≟ PtA ∨ animateControl ≟ 2 ∧ displayPointsAnimate(4) ≟ PtA
showSecond: animateControl > 0 ∧ displayPointsAnimate(1) ≟ AnchorFigure ∨ animateControl ≥ 1 ∧ displayPointsAnimate(2) ≟ AnchorFigure ∨ animateControl ≟ 2 ∧ displayPointsAnimate(4) ≟ AnchorFigure
showThird: animateControl > 0 ∧ displayPointsAnimate(1) ≟ PtB ∨ animateControl ≥ 1 ∧ displayPointsAnimate(2) ≟ PtB ∨ animateControl ≟ 2 ∧ displayPointsAnimate(4) ≟ PtB
highlightLabels = Zip(animateControl > 0 ∧ displayPointsAnimate(1) ≟ A ∨ animateControl ≥ 1 ∧ displayPointsAnimate(2) ≟ A ∧ displayPointsAnimate(1) ≠ displayPointsAnimate(3) ∨ animateControl ≟ 2 ∧ displayPointsAnimate(4) ≟ A ∧ showFinalLabel, A, {PtA, AnchorFigure, PtB})
animateRay2 = Segment(displayPointsAnimate(3), displayPointsAnimate(4))
animateRay1 = Segment(displayPointsAnimate(If[displayPointsAnimate(1) ≟ displayPointsAnimate(3), 2, 1]), displayPointsAnimate(If[displayPointsAnimate(1) ≟ displayPointsAnimate(3), 1, 2]))
isTypicalError: (¬correctSymbol) ∨ (¬correctLength) ∨ (¬currentCorrect)
showAnimate: tries > 1 ∧ (¬(showhint ∨ showhinttypicalerror))
pulsingObjects = Zip(expandQuad[Vertex[A, 1], Vertex[A, 2], Vertex[A, 3], Vertex[A, 4], (7 * pulsing), Corner[1], Corner[3], Corner[5]], A, Sequence[Element[{box1, box2, box3, box4}, A], A, 1, 4])
lblBtnValidate: "\text{CHEQUEAR (" + (LaTeX[3 - tries]) + ")}"
scoreCounter: "\text{\textbf{Puntaje total:} \colorbox{" + (LaTeX[colorTealLight]) + "}\textcolor{WHITE}\textbf{" + (LaTeX[totalPoints]) + "}" + (LaTeX[If[countQuestion > 0, (((" en " * countQuestion) * " juego") * If[countQuestion ≟ 1, "", "s"])]]) + "}"
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Pista}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + ""
feedbackMsg: "\text{" + (LaTeX[(("Halla " * If[numCorrect > 0, Element[{"una manera más", "dos maneras más"}, 3 - numCorrect], "tres maneras"]) * " de nombrar este ángulo.")]) + "}"
numFoundText: "\text{" + (LaTeX[numCorrect]) + " de 3 nombres encontrado" + (LaTeX[If[numCorrect ≟ 1, "", "s"]]) + "" + (LaTeX[Element[{"", (": " * foundList(1)), (((": " * foundList(1)) * ", ") * foundList(2)), (((((": " * foundList(1)) * ", ") * foundList(2)) * ", ") * foundList(3))}, Length[foundList] + 1]]) + "}"
msgPoints: "\text{" + (LaTeX[If[tries ≟ 0, "Puedes ganar hasta \textbf{6 puntos} con esta pregunta. ", (("\textbf{" * pointsThisTurn) * "/6 puntos} obtenidos.")]]) + "}"
textFeedback: "" + (LaTeX[If[currentCorrect, (("$\text\textcolor{" * colorTealSuccess) * "}{✓ Correcto }"), (("$\text\textcolor{" * colorRedError) * "}{✕ ") + (If[duplicateName, "Ya utilizaste este nombre.", If[tries < 3, "Reinténtalo", "Quizás la próxima vez"]]) + "}"]]) + ""
textSolution: "\textsf{\bold{Posible solución}\\
El ángulo puede nombrarse de las siguientes maneras:\\
\(\angle " + (LaTeX[letterSet(correctOrder(1, 2))]) + "" + (LaTeX[letterSet(correctOrder(1, 3))]) + "" + (LaTeX[letterSet(correctOrder(1, 4))]) + ",~\angle " + (LaTeX[letterSet(correctOrder(2, 2))]) + "" + (LaTeX[letterSet(correctOrder(2, 3))]) + "" + (LaTeX[letterSet(correctOrder(2, 4))]) + "\) y \(\angle " + (LaTeX[letterSet(correctOrder(3, 2))]) + "\)}"

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: expandSegment
expandSegment(A,B,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, pixelGap, Corner1, Corner3, Corner5
Output: newPoly

distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
pointGap: distanceX
xyScale: distanceY / distanceX
A: (0, 0)
vecAB: B - A
pVec: (20 * UnitVector[(((-y(vecAB))) / xyScale, (x(vecAB) * xyScale))])
pVecAngle = Angle(xAxis, Line[(0, 0), pVec])
realAngle = If(pVecAngle ≟ pi / 2 ∨ pVecAngle ≟ (3 * pi / 2), pVecAngle, atand(tan(pVecAngle) / xyScale))
curveFunction = CurveCartesian((pointGap * cos(u)), ((pointGap * xyScale) * sin(u)), u, 0, (2 * pi))
K: curveFunction(realAngle)
vSpace = Vector(K)
allPoints: {A + vSpace, A - vSpace, B - vSpace, B + vSpace}
newPoly = Polygon(allPoints)

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: centerBox
(width,height,CenterPoint)
Input: width, length, StartPoint
Output: myBox

StartPoint: (0, 0)
A: StartPoint + (((-width)) / 2, ((-length)) / 2)
D: A + (0, length)
B: A + (width, 0)
C: A + (width, length)
myBox = Polygon({A, B, C, D})

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

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: expandQuad (command expandQuad1)
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)