FractionMultiplication

Fraction multiplicatoin

allow fractions greater than 1

Show product

d = false
mymax: 2
unit: 2
v = Vector((0, unit))
h = Vector((unit, 0))
A = (0.675688243046631, -1.1651603487891065)
maxunits: 1 + (d * mymax)
D: A + (0.1 * v)
B = (0.675688243046631, -0.5275932935331668)
a: x(B)
b: y(B)
f = Segment(A, A + h)
C = Point(f)
maxden: 12
den1 = Max(ceil(((x(C) - x(A)) * maxden / unit)), 1)
g = Segment(D, D + (maxunits * h))
E = Point(g)
num1: ceil(((x(E) - x(D)) * den1 / unit))
hsquares = Max(ceil(num1 / den1), 1)
text1: "Each whole set is worth $\frac{ " + (LaTeX[num1]) + "}{" + (LaTeX[den1]) + "}$ of a unit"
text2: "" + den1 + ""
text3: "" + num1 + ""
q1, b_1, i, j, k = Polygon(B, B + (num1 / den1 * h), B + (num1 / den1 * h) + v, B + v)
F = (0.6390585189187481, -2.446406293282892)
l = Segment(F, F + h)
G: F + (v * 0.1)
m = Segment(G, G + (maxunits * h))
H = Point(l)
I = Point(m)
den2 = Max(ceil(((x(H) - x(F)) * maxden / unit)), 1)
num2: ceil(((x(I) - x(G)) * den2 / unit))
text4: "" + den2 + ""
text5: "" + num2 + ""
c = true
vsquares = Max(ceil(num2 / den2), 1)
L_2 = Sequence(Segment[B + (i * v), B + (i * v) + (hsquares * h)], i, 0, 1 + (c * (vsquares - 1)))
L_1 = Sequence(Segment[B + (i * h), B + (i * h) + (v * (1 + (c * (vsquares - 1))))], i, 0, hsquares)
hsubdiv = Sequence(Sequence[Segment[B + (h * (i / den1 + j)), B + (h * (i / den1 + j)) + (v * (1 + (c * (vsquares - 1))))], i, 1, den1 - 1], j, 0, hsquares - 1)
vsubdiv = Sequence(Sequence[Segment[B + (v * (i / den2 + j)), B + (v * (i / den2 + j)) + (h * hsquares)], i, 1, den2 - 1], j, 0, vsquares - 1)
text6: "Green shows the units in $\frac{" + (LaTeX[num2]) + "}{" + (LaTeX[den2]) + "}$ (of a) set(s)"
q2, b_2, n, p, q = Polygon(B, B + (h * num1 / den1), B + (h * num1 / den1) + (v * num2 / den2), B + (v * num2 / den2))