#4D4D4D

$\text{Check}$

$\text{NEW PROBLEM}$

Fix position and allow selection for all text objects

\text{\bold{Possible Solution}\See the simplified\form of each\expression.}

Reset app

\text{Check whether all the\expressions with the\same value are\grouped together.\There is at least one\incomplete group.}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{Check whether the \expressions in each\group have the same\value.}

#eeeeee

#2E006758

#2EB00020

\text{Drag into the boxes}

\text{Sort the cards into groups of expressions that have the same value.} 

organize

C8 = (-4.55, 0.3999999999999999)
C7 = (-4.75, 0.8)
C6 = (-4.699999999999999, 0.7)
C5 = (-4.6499999999999995, 0.6)
C4 = (-4.85, 1)
C3 = (-4.8, 0.9)
C2 = (-4.6, 0.5)
C1 = (-4.5, 0.29999999999999993)
hei: 0.65
indices4 = Sample(Sequence[26, 34], 3)
indices3 = Sample(Sequence[17, 25], 3)
indices2 = Sample(Sequence[9, 16], 3)
indices1 = Sample(Sequence[8], 3)
indicesAll = Shuffle(Join[{indices1, indices2, indices3, indices4}])
indices = Take(indicesAll, 1, 8)
indices4coded = RemoveUndefined(Zip[IndexOf[kk, indices], kk, indices4])
indices3coded = RemoveUndefined(Zip[IndexOf[kk, indices], kk, indices3])
indices2coded = RemoveUndefined(Zip[IndexOf[kk, indices], kk, indices2])
indices1coded = RemoveUndefined(Zip[IndexOf[kk, indices], kk, indices1])
expected = RemoveUndefined(Zip[Sort[ll], ll, {indices1coded, indices2coded, indices3coded, indices4coded}])
wid2: 1.95
wid: wid2 - 0.2
vec: Vector[Corner[1], Corner[2]] / 100 + (wid2, 0)
hei2: 0.75
DropArea1 = Polygon({(-2.5, -2.68), (-2.5, -2.68) + (wid2, 0), (-2.5, -2.68) + (wid2, (6 * hei2) + 0.1), (-2.5, -2.68) + (0, (6 * hei2) + 0.1)})
target1 = Sequence(Vertex[DropArea1, 4] - ((0, hei2) * ii) + (0.1, 0), ii, 1, 6)
target2 = Translate(target1, vec)
target3 = Translate(target2, vec)
target4 = Translate(target3, vec)
box8In = IndexOf(true, Zip[Defined[IndexOf[C8, ll]], ll, {target1, target2, target3, target4}])
box7In = IndexOf(true, Zip[Defined[IndexOf[C7, ll]], ll, {target1, target2, target3, target4}])
box6In = IndexOf(true, Zip[Defined[IndexOf[C6, ll]], ll, {target1, target2, target3, target4}])
box5In = IndexOf(true, Zip[Defined[IndexOf[C5, ll]], ll, {target1, target2, target3, target4}])
box4In = IndexOf(true, Zip[Defined[IndexOf[C4, ll]], ll, {target1, target2, target3, target4}])
box3In = IndexOf(true, Zip[Defined[IndexOf[C3, ll]], ll, {target1, target2, target3, target4}])
box2In = IndexOf(true, Zip[Defined[IndexOf[C2, ll]], ll, {target1, target2, target3, target4}])
box1In = IndexOf(true, Zip[Defined[IndexOf[C1, ll]], ll, {target1, target2, target3, target4}])
boxesInT4 = RemoveUndefined(Sequence[If[Element[{box1In, box2In, box3In, box4In, box5In, box6In, box7In, box8In}, kk] ≟ 4, kk], kk, 1, 8])
indicesInT4 = If(Length[boxesInT4] ≥ 1, Zip[Element[indicesAll, kk], kk, boxesInT4], {})
boxesInT3 = RemoveUndefined(Sequence[If[Element[{box1In, box2In, box3In, box4In, box5In, box6In, box7In, box8In}, kk] ≟ 3, kk], kk, 1, 8])
indicesInT3 = If(Length[boxesInT3] ≥ 1, Zip[Element[indicesAll, kk], kk, boxesInT3], {})
boxesInT2 = RemoveUndefined(Sequence[If[Element[{box1In, box2In, box3In, box4In, box5In, box6In, box7In, box8In}, kk] ≟ 2, kk], kk, 1, 8])
indicesInT2 = If(Length[boxesInT2] ≥ 1, Zip[Element[indicesAll, kk], kk, boxesInT2], {})
boxesInT1 = RemoveUndefined(Sequence[If[Element[{box1In, box2In, box3In, box4In, box5In, box6In, box7In, box8In}, kk] ≟ 1, kk], kk, 1, 8])
indicesInT1 = If(Length[boxesInT1] ≥ 1, Zip[Element[indicesAll, kk], kk, boxesInT1], {})
inputCurrent: {boxesInT1, boxesInT2, boxesInT3, boxesInT4}
inputCurrentNoEmpty = Zip(Sort[ll], ll, KeepIf[Length[ll] ≥ 1, ll, inputCurrent])
comparing = Zip(Defined[IndexOf[ll, inputCurrentNoEmpty]], ll, expected)
WID: 2.5
setDiff1 = Zip(indicesInT1 \ ll, ll, {indices1, indices2, indices3, indices4})
correct1 = Defined(IndexOf[0, Zip[Length[LL], LL, setDiff1]])
setDiff2 = Zip(indicesInT2 \ ll, ll, {indices1, indices2, indices3, indices4})
correct2 = Defined(IndexOf[0, Zip[Length[LL], LL, setDiff2]])
setDiff3 = Zip(indicesInT3 \ ll, ll, {indices1, indices2, indices3, indices4})
correct3 = Defined(IndexOf[0, Zip[Length[LL], LL, setDiff3]])
setDiff4 = Zip(indicesInT4 \ ll, ll, {indices1, indices2, indices3, indices4})
correct4 = Defined(IndexOf[0, Zip[Length[LL], LL, setDiff4]])
HEI: 4
countQuestion = 0
allRandomSeeds = Sequence(Random[0, 99] / 100, A, 1, 200)
numRandoms: 3
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
inputPoint: (0, 0)
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
PAnswer: (-1 - floor((currentRandomSeeds(1) * 3)), (2 * (-1 - floor((currentRandomSeeds(2) * 1)))))
onboarding = true
inputSaved: {}
validate = false
showanswer = false
showsolution = false
tries = 0
countCorrect = 0
showhint = false
correctSol = false
correct: (¬Defined[IndexOf[false, comparing]]) ∧ (¬correctSol)
showbuttons = true
showhinttypicalerror = false
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16 + 36 + 24 + 16 + 8
pixelsTop: 24 + 16 + 8
layoutY: 448
enableInput: tries < 3 ∧ (¬(validate ∧ correct))
layoutX: 170 + 24
layoutAppSize = Corner(5)
inputPointLastPos: (0, 1)
TriA: (5, 0)
TriB: (0, 6)
textCountCorrect: "\text{Number correct: " + (LaTeX[countCorrect]) + " }"
enableBtnValidate: inputCurrent ≠ inputSaved ∧ Length[Join[{boxesInT1, boxesInT2, boxesInT3, boxesInT4}]] ≟ 8
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "Try again", "Maybe next time"]) + "}$"]]) + ""
pulsing = 0.3 (slider from 0 to 1, step 0.1)
pulsingSpeed: 8
haloPixels: (pulsing * 7)
tri, b, inputpoint, a = Polygon(inputPoint, TriA, TriB)
pulseColor: (37 + (pulsing * 218)) / 255
onboardingCase = 3
onboardingX = 88
onboardingY: 226 + 8
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
numA: 2 + floor((currentRandomSeeds(1) * 4))
nums2 = KeepIf(GCD[kk, numA] ≟ 1, kk, Sequence[1, 3])
numB: 1 + floor((currentRandomSeeds(1) * (Length[nums2] - 1)))
num2 = Element(nums2, numB)
mult: 2 + floor((currentRandomSeeds(1) * 2))
numC: (mult * numA)
numD: (mult * numB)
groupAB: {If[numB ≟ 1, Text[numA], (((("\frac{" * numA) * "}{") * numB) * "}")], (((("\frac{" * numC) * "}{") * numD) * "}"), ((numA * "\div") * numB), ((numC * "\div") * numD), (((("\frac{" * (-numA)) * "}{") * (-numB)) * "}"), (((("\frac{" * (-numC)) * "}{") * (-numD)) * "}"), ((((-numA) * "\div(") * (-numB)) * ")"), ((((-numC) * "\div(") * (-numD)) * ")")}
groupBA: {(((("\frac{" * numB) * "}{") * numA) * "}"), (((("\frac{" * numD) * "}{") * numC) * "}"), ((numB * "\div") * numA), ((numD * "\div") * numC), (((("\frac{" * (-numB)) * "}{") * (-numA)) * "}"), (((("\frac{" * (-numD)) * "}{") * (-numC)) * "}"), ((((-numB) * "\div(") * (-numA)) * ")"), ((((-numD) * "\div(") * (-numC)) * ")")}
groupABMin: {If[numB ≟ 1, Text[(-numA)], (((("\frac{" * (-numA)) * "}{") * numB) * "}")], (((("\frac{" * (-numC)) * "}{") * numD) * "}"), (((-numA) * "\div") * numB), (((-numC) * "\div") * numD), (((("\frac{" * numA) * "}{") * (-numB)) * "}"), (((("\frac{" * numC) * "}{") * (-numD)) * "}"), (((numA * "\div(") * (-numB)) * ")"), (((numC * "\div(") * (-numD)) * ")"), (((("-\frac{" * numA) * "}{") * numB) * "}")}
groupBAMin: {(((("\frac{" * (-numB)) * "}{") * numA) * "}"), (((("\frac{" * (-numD)) * "}{") * numC) * "}"), (((-numB) * "\div") * numA), (((-numD) * "\div") * numC), (((("\frac{" * numB) * "}{") * (-numA)) * "}"), (((("\frac{" * numD) * "}{") * (-numC)) * "}"), (((numB * "\div(") * (-numA)) * ")"), (((numD * "\div(") * (-numC)) * ")"), (((("-\frac{" * numB) * "}{") * numA) * "}")}
groupsAll = Join({groupAB, groupBA, groupABMin, groupBAMin})
q1, c1, f, g, h = Polygon(C1, C1 + (wid, 0), C1 + (wid, hei), C1 + (0, hei))
q2, c2, i, j, k = Polygon(C2, C2 + (wid, 0), C2 + (wid, hei), C2 + (0, hei))
q3, c3, l, m, n = Polygon(C3, C3 + (wid, 0), C3 + (wid, hei), C3 + (0, hei))
q4, c4, p, q, r = Polygon(C4, C4 + (wid, 0), C4 + (wid, hei), C4 + (0, hei))
q5, c5, s, t, c = Polygon(C5, C5 + (wid, 0), C5 + (wid, hei), C5 + (0, hei))
q6, c6, d, e, f_1 = Polygon(C6, C6 + (wid, 0), C6 + (wid, hei), C6 + (0, hei))
q7, c7, g_1, h_1, i_1 = Polygon(C7, C7 + (wid, 0), C7 + (wid, hei), C7 + (0, hei))
q8, c8, j_1, k_1, l_1 = Polygon(C8, C8 + (wid, 0), C8 + (wid, hei), C8 + (0, hei))
DropArea2 = Translate(DropArea1, vec)
DropArea3 = Translate(DropArea2, vec)
DropArea4 = Translate(DropArea3, vec)
MoveGL = (2.0032312421178387, 2.266120792366547)
p_1: y = y(MoveGL)
m_1 = Translate(p_1, ((Corner[4] - Corner[1]) / 500 * 16))
eq1: x = x(Corner[1]) + (x(Corner[2] - Corner[1]) / 800 * 16)
eq2: x = x(Corner[2]) - (x(Corner[2] - Corner[1]) / 800 * 16)
Cor1 = (-5.029355192898126, -3.79359016579162)
Cor3 = (5.741336223433944, 2.9481643117628673)
home = Sequence((-4.85, 1) + ((ii * 0.05), ((-ii) * 0.1)), ii, 0, 8)
FixedPoints = Join({target1, target2, target3, target4, home})
boxesInMovement = Zip(¬Defined[IndexOf[PP, FixedPoints]], PP, {C1, C2, C3, C4, C5, C6, C7, C8})
red = Zip(If[kk, 180, 226] / 255, kk, boxesInMovement)
green = Zip(If[kk, 170, 223] / 255, kk, boxesInMovement)
blue = Zip(If[kk, 248, 252] / 255, kk, boxesInMovement)
intersectionsBox2 = Zip(Area[IntersectPath[q2, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox1 = Zip(Area[IntersectPath[q1, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox3 = Zip(Area[IntersectPath[q3, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox4 = Zip(Area[IntersectPath[q4, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox5 = Zip(Area[IntersectPath[q5, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox6 = Zip(Area[IntersectPath[q6, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox7 = Zip(Area[IntersectPath[q7, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
intersectionsBox8 = Zip(Area[IntersectPath[q8, pp]], pp, {DropArea1, DropArea2, DropArea3, DropArea4})
box1To = IndexOf(Max[RemoveUndefined[intersectionsBox1]], intersectionsBox1)
box2To = IndexOf(Max[RemoveUndefined[intersectionsBox2]], intersectionsBox2)
box3To = IndexOf(Max[RemoveUndefined[intersectionsBox3]], intersectionsBox3)
box4To = IndexOf(Max[RemoveUndefined[intersectionsBox4]], intersectionsBox4)
box5To = IndexOf(Max[RemoveUndefined[intersectionsBox5]], intersectionsBox5)
box6To = IndexOf(Max[RemoveUndefined[intersectionsBox6]], intersectionsBox6)
box7To = IndexOf(Max[RemoveUndefined[intersectionsBox7]], intersectionsBox7)
box8To = IndexOf(Max[RemoveUndefined[intersectionsBox8]], intersectionsBox8)
locationOfEachBox: {box1In, box2In, box3In, box4In, box5In, box6In, box7In, box8In}
inTarget1 = CountIf(x ≟ 1, locationOfEachBox)
inTarget2 = CountIf(x ≟ 2, locationOfEachBox)
inTarget3 = CountIf(x ≟ 3, locationOfEachBox)
inTarget4 = CountIf(x ≟ 4, locationOfEachBox)
target1Disp: target1 \ {C1, C2, C3, C4, C5, C6, C7, C8}
target2Disp: target2 \ {C1, C2, C3, C4, C5, C6, C7, C8}
target3Disp: target3 \ {C1, C2, C3, C4, C5, C6, C7, C8}
target4Disp: target4 \ {C1, C2, C3, C4, C5, C6, C7, C8}
numActiveDropArea = Element({box1To, box2To, box3To, box4To, box5To, box6To, box7To, box8To}, IndexOf[true, boxesInMovement])
ActiveDropAreaW = Element({DropArea1, DropArea2, DropArea3, DropArea4}, numActiveDropArea)
ActiveDropArea: ActiveDropAreaW
ec1: x = x(MoveGL)
ec1' = Translate(ec1, ((x(Corner[2] - Corner[1]) / 800 * 16), 0))
q1Border: q1
q2Border: q2
q3Border: q3
q4Border: q4
q5Border: q5
q6Border: q6
q7Border: q7
q8Border: q8
mixedGroups: (¬correct1) ∨ (¬correct2) ∨ (¬correct3) ∨ (¬correct4)
textHint: "\text{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}\\" + (LaTeX[If[mixedGroups, helpTextHint, helpTextHintTypicalError]]) + "}"
shouldbe = Sequence(IndexOf[true, Zip[Defined[IndexOf[kk, LL]], LL, {indices1coded, indices2coded, indices3coded, indices4coded}]], kk, 1, 8)
complementText = Zip(Element[{groupAB(1), groupBA(1), groupABMin(1), ("-" * groupBA(1))}, kk], kk, shouldbe)
text1 = Text(Element[groupsAll, indices(1)] + (If[showsolution, ("=" * complementText(1)), ""]), Centroid[q1], true, true, 0, 0)
text2 = Text(Element[groupsAll, indices(2)] + (If[showsolution, ("=" * complementText(2)), ""]), Centroid[q2], true, true, 0, 0)
text3 = Text(Element[groupsAll, indices(3)] + (If[showsolution, ("=" * complementText(3)), ""]), Centroid[q3], true, true, 0, 0)
text4 = Text(Element[groupsAll, indices(4)] + (If[showsolution, ("=" * complementText(4)), ""]), Centroid[q4], true, true, 0, 0)
text5 = Text(Element[groupsAll, indices(5)] + (If[showsolution, ("=" * complementText(5)), ""]), Centroid[q5], true, true, 0, 0)
text6 = Text(Element[groupsAll, indices(6)] + (If[showsolution, ("=" * complementText(6)), ""]), Centroid[q6], true, true, 0, 0)
text7 = Text(Element[groupsAll, indices(7)] + (If[showsolution, ("=" * complementText(7)), ""]), Centroid[q7], true, true, 0, 0)
text8 = Text(Element[groupsAll, indices(8)] + (If[showsolution, ("=" * complementText(8)), ""]), Centroid[q8], true, true, 0, 0)
pulsingObject = expandQuad(home(8), home(8) + (wid, 0), home(8) + (wid, hei), home(8) + (0, hei), (7 * pulsing), Corner[1], Corner[3], Corner[5])
order: {8, 6, 2, 1, 5, 4, 3, 7}
corners: {C1, C2, C3, C4, C5, C6, C7, C8}
cornersInT1 = Reverse(Sort[Zip[Element[corners, kk], kk, boxesInT1]])
cornersInT1names = Zip("C" + (IndexOf[PP, corners]), PP, cornersInT1)
cornersInT2 = Reverse(Sort[Zip[Element[corners, kk], kk, boxesInT2]])
cornersInT3 = Reverse(Sort[Zip[Element[corners, kk], kk, boxesInT3]])
cornersInT4 = Reverse(Sort[Zip[Element[corners, kk], kk, boxesInT4]])
cornersInT2names = Zip("C" + (IndexOf[PP, corners]), PP, cornersInT2)
cornersInT3names = Zip("C" + (IndexOf[PP, corners]), PP, cornersInT3)
cornersInT4names = Zip("C" + (IndexOf[PP, corners]), PP, cornersInT4)
organizet1 = If(Length[boxesInT1] ≠ 0, Zip[(((("SetValue(" * ii) * ",") * PP) * ")"), ii, cornersInT1names, PP, target1], {})
organizet2 = If(Length[boxesInT2] ≠ 0, Zip[(((("SetValue(" * ii) * ",") * PP) * ")"), ii, cornersInT2names, PP, target2], {})
organizet3 = If(Length[boxesInT3] ≠ 0, Zip[(((("SetValue(" * ii) * ",") * PP) * ")"), ii, cornersInT3names, PP, target3], {})
organizet4 = If(Length[boxesInT4] ≠ 0, Zip[(((("SetValue(" * ii) * ",") * PP) * ")"), ii, cornersInT4names, PP, target4], {})
correctGroups = Zip(LL ∈ expected, LL, inputCurrent)
DropAreaBG1: DropArea1
DropAreaBG2: DropArea2
DropAreaBG3: DropArea3
DropAreaBG4: DropArea4
colorDropAreasBg = Sequence((((((((("SetDynamicColor(DropAreaBG" * kk) * ",If(correctGroups(") * kk) * "),210,241)/255,If(correctGroups(") * kk) * "),228,210)/255,If(correctGroups(") * kk) * "),226,216)/255)"), kk, 1, 4)
D1 = (-0.3409901796169619, 0.4199999999999995)
D2 = (-0.3409901796169619, 1.1699999999999995)
D3 = (-2.4, 0.4199999999999995)
D4 = (1.7180196407660762, 1.1699999999999995)
D5 = (3.777029461149114, 0.4199999999999995)
D6 = (-2.4, 1.1699999999999995)
D7 = (3.777029461149114, 1.1699999999999995)
D8 = (1.7180196407660762, 0.4199999999999995)
T8 = (3.777029461149114, 0.4199999999999995)
T7 = (-0.3409901796169619, 0.4199999999999995)
T6 = (3.777029461149114, 1.1699999999999995)
T5 = (-0.3409901796169619, 1.1699999999999995)
T4 = (1.7180196407660762, 1.1699999999999995)
T3 = (-2.4, -0.3300000000000005)
T2 = (-2.4, 0.4199999999999995)
T1 = (-2.4, 1.1699999999999995)
count: {4, 3, 2, 3}
anim = 0 (slider from 0 to 1, step 0.1)
speedAnim = If(correctSol, 5, -5)
labelBtnAnimSol = Text(If[correctSol, "$\textsf{YOUR SOLUTION}$", "$\textsf{SHOW SOLUTION}$"], (0, 0), true, true)
isTypicalError: false
DropArea1S: DropArea1
DropArea2S: DropArea2
DropArea3S: DropArea3
DropArea4S: DropArea4
colorDropAreas = Sequence((((((((((((((("SetDynamicColor(DropArea" * kk) * ",If((showhint∨showsolution)&&(anim==0∨anim==1)&&Length(inputCurrent(") * kk) * ")) ≥ 1,If(correctGroups(") * kk) * "),0,176),101)/255,If((showhint∨showsolution)&&(anim==0∨anim==1)&&Length(inputCurrent(") * kk) * ")) ≥ 1,If(correctGroups(") * kk) * "),103,0),87)/255,If((showhint∨showsolution)&&(anim==0∨anim==1)&&Length(inputCurrent(") * kk) * ")) ≥ 1,If(correctGroups(") * kk) * "),88,32),210)/255)"), kk, 1, 4)

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: 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)