$\textsf{%v}$

$\textsf{%v}$

#4D4D4D

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#4D4D4D

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

$\textsf{1}$

$\textsf{NEW FRACTION}$

\text{Numerator}

\text{Denominator}

example: 0
n = 1 (slider from 1 to 30, step 1)
bList = Shuffle({2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15})
b = Element(bList, Mod[example, Length[bList]] + 1)
relativePrimes = KeepIf(Length[Intersection[PrimeFactors[ii], PrimeFactors[b]]] ≟ 0, ii, Sequence[b])
wid: (14, 0)
pixelsTop: 16
hei = Vector((0, -1.8))
pixelsBottom: 16
pixelsLeft: 16
pixelsRight: 16
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)}])
A, B, C, D = Vertex(borderBox)
A': (-3.55, 6.8)
A''_{1} = Translate(A', hei)
J = Translate(A''_{1}, Vector[wid / b])
wid1part = Vector(A''_{1}, J)
PositionsFakeSlider = Zip(Translate[(x(A'), 6.8), Vector[(wid1part * kk)]], kk, relativePrimes)
FakeSliderPoint = Point(PositionsFakeSlider)
AppSize = Corner(5)
A'_{1} = Translate(A, wid)
A'' = Translate(A', wid)
q1, a_{1}, a', a'', a'_{1} = Polygon(A, A', A'', A'_{1})
A'_{2} = Translate(A, hei)
A''' = Translate(A'', hei)
E = Translate(A'_{1}, hei)
q1', a'_{2}, a''_{1}, a''', e = Polygon(A'_{2}, A''_{1}, A''', E)
F = Translate(A''_{1}, Vector[(0.8 * hei)])
G = Translate(F, hei)
H = Translate(G, wid)
E' = Translate(E, Vector[(2 * hei)])
q1'', f, g, h, e' = Polygon(F, G, H, E')
a = IndexOf(FakeSliderPoint, PositionsFakeSlider)
maxA = Length(relativePrimes)
I = Translate(A', Vector[wid / b])
q2, i, j, i_1, k = Polygon(A''_{1}, J, I, A')
denMod1 = Sequence(Polygon[Translate[A''_{1}, Vector[(wid1part * ii)]], Translate[J, Vector[(wid1part * ii)]], Translate[I, Vector[(wid1part * ii)]], Translate[A', Vector[(wid1part * ii)]]], ii, 0, b - 1)
numMod1 = Sequence(Polygon[Translate[A''_{1}, Vector[(wid1part * ii)]], Translate[J, Vector[(wid1part * ii)]], Translate[I, Vector[(wid1part * ii)]], Translate[A', Vector[(wid1part * ii)]]], ii, 0, Element[relativePrimes, a] - 1)
G' = Translate(G, Vector[(wid1part * Element[relativePrimes, a])])
F' = Translate(F, Vector[(wid1part * Element[relativePrimes, a])])
GreenRectangleBelow = Polygon({F, G, G', F'})
F'_{1} = Translate(F, Vector[wid / n])
G'_{1} = Translate(G, Vector[wid / n])
DivisionsBelow = Sequence(Translate[Polygon[{F, G, G'_{1}, F'_{1}}], Vector[(wid / n * ii)]], ii, 0, n - 1)
equiv: Mod[n, b] ≟ 0
num: (Element[relativePrimes, IndexOf[FakeSliderPoint, PositionsFakeSlider]] * n / b)
sliderALabel: "\textsf{\;" + (LaTeX[Element[relativePrimes, a]]) + "\vphantom{g}\\\\}"
divisionsAbove = Sequence(Segment[Translate[A''_{1}, Vector[(wid1part * ii)]], Translate[F, Vector[(wid1part * ii)]]], ii, 0, b)
FakeSlider1: (x(A), y(Corner[1]) + (435 * y(Corner[3] - Corner[1]) / y(Corner[5])))
FakeSlider2: (x(A''), y(Corner[1]) + (435 * y(Corner[3] - Corner[1]) / y(Corner[5])))
fakeSlider_{1} = Segment(FakeSlider1, FakeSlider2)
animNum = 0 (slider from 0 to 1)
speed: 10
animDen = 0 (slider from 0 to 1)
q4, l, m, p, q = Polygon(A', A''_{1}, A''', A'')
q5 = Polygon({F, G, H, (x(H), y(F))})
fakeSlider = Segment(Element[PositionsFakeSlider, 1], Element[PositionsFakeSlider, Length[PositionsFakeSlider]])
fakeSliderLabel = Text(sliderALabel, FakeSliderPoint, true, true, 0, 1)
fracEquiv: "\frac{\textcolor{" + (LaTeX[colorTealLight_{1}]) + "}{" + (LaTeX[Element[relativePrimes, a]]) + "}}{" + (LaTeX[b]) + "}" + (LaTeX[If[equiv, (((("=\frac{" * num) * "}{\textcolor{#E07415}{") * n) * "}}")]]) + ""
fackeSliderDash = Segment((x(A), y(A) - (3 / 5 * (y(A) - y(A')))), (x(A), y(A) - (3 / 5 * (y(A) - y(A')))) + wid)
FakeSliderPoint' = Translate(FakeSliderPoint, Vector[A', G])
verticalSegment = Segment(FakeSliderPoint, FakeSliderPoint')
MoveGL = (-3.5763936000000025, -1.5713576000000125)
hGL: y = y(MoveGL)
hGL' = Translate(hGL, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)])
Cor1 = (-6.294300000000003, -3.8159000000000125)
Cor3 = (13.194300000000002, 8.38269999999999)
denominators: {}
numerators = If(Length[denominators] ≟ 0, {}, Zip[(Element[relativePrimes, a] * kk / b), kk, denominators])
l1 = Zip((((((("=\frac{" * nn) * "}{\textcolor{") * colorPurpleButton_{1}) * "}{") * dd) * "}}"), nn, numerators, dd, denominators)
fracOriginal: "\frac{ \textcolor{" + (LaTeX[colorPink_{1}]) + "}{" + (LaTeX[Element[relativePrimes, a]]) + "}}{{" + (LaTeX[b]) + "}}" + (LaTeX[Sum[l1]]) + ""
eq1: x = x(MoveGL)
text1: "" + (LaTeX[centerText["750", fracOriginal]]) + ""

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: centerText
centerText(sizeStr,textStr)
Input: sizeStr, textString
Output: centeredLatex

this is dynamic centered text

centeredLatex: (((("\begin{tabular}\hspace{" * sizeStr) * "}\\") * textString) * "\end{tabular}")