Show a/b sets of size c/d

red shows a set of size c/d units

show one set of size c/d

blue shows a/b sets

d = 4 (slider from 1 to 12, step 1)
c = 3 (slider from 1 to 3 * d, step 1)
s1: c ≥ d
sz = 3
A = (-4.063221000443456, -5.223201543237251)
inc = 0 (slider from 0 to 1.5, step 0.02)
a = 2 (slider from 1 to 3 * b, step 1)
b = 3 (slider from 1 to 12, step 1)
A2: (x(A), y(A) + sz)
A3: (x(A) + sz, y(A) + sz)
A1: (x(A) + sz, y(A))
e = Segment(A, A1)
f = Segment(A1, A3)
g = Segment(A3, A2)
B: (x(A), y(A) + sz + inc)
h = Segment(A2, A)
C: (x(A), y(A) + 2 * sz + 2 * inc)
list1 = Sequence(Segment[(x(A) + sz * i / d, y(A)), (x(A) + sz * i / d, y(A) + sz)], i, 1, d - 1)
CD1: (x(A) + sz * c / d, y(A))
CD3: (x(A) + sz * c / d, y(A) + sz)
poly1, a_1, cd1, cd3, a2 = Polygon(A, CD1, CD3, A2)
g1: a ≥ b
g2: a ≥ 2 * b
B1: (x(B) + sz, y(B))
B2: (x(B), y(B) + sz)
B3: (x(B) + sz, y(B) + sz)
i = Segment(B, B2)
j = Segment(B2, B3)
k = Segment(B3, B1)
l = Segment(B, B1)
list2 = Sequence(Segment[(x(B) + sz * i / d, y(B)), (x(B) + sz * i / d, y(B) + sz)], i, 1, d - 1)
C3: (x(C) + sz, y(C) + sz)
C2: (x(C), y(C) + sz)
C1: (x(C) + sz, y(C))
list3 = Sequence(Segment[(x(C) + sz * i / d, y(C)), (x(C) + sz * i / d, y(C) + sz)], i, 1, d - 1)
m = Segment(C2, C)
n = Segment(C1, C)
p = Segment(C3, C2)
q = Segment(C1, C3)
list4 = Sequence(Segment[(x(C), y(C) + sz * i / b), (x(C) + sz, y(C) + sz * i / b)], i, 1, b - 1)
list5 = Sequence(Segment[(x(B), y(B) + sz * i / b), (x(B) + sz, y(B) + sz * i / b)], i, 1, b - 1)
list6 = Sequence(Segment[(x(A), y(A) + sz * i / b), (x(A) + sz, y(A) + sz * i / b)], i, 1, b - 1)
abh1 = Min(sz, sz * a / b)
abh2: g1 * Min[sz, sz * (a - b) / b]
abh3: g2 * Min[sz, sz * (a - 2 * b) / b]
Aab2: (x(A), y(A) + abh1)
Aab3: (x(A) + sz * c / d, y(A) + abh1)
Bab1: (x(B) + c * sz / d, y(B))
Bab2: (x(B), y(B) + abh2)
Bab3: (x(B) + sz * c / d, y(B) + abh2)
Cab1: (x(C) + c * sz / d, y(C))
Cab2: (x(C), y(C) + abh3)
Cab3: (x(C) + c * sz / d, y(C) + abh3)
o = true
list7 = Sequence(Segment[(x(A) + sz + inc + sz * i / d, y(A)), (x(A) + sz + inc + sz * i / d, y(A) + sz)], i, 0, d)
list8 = Sequence(Segment[(x(A) + 2 * sz + 2 * inc + sz * i / d, y(A)), (x(A) + 2 * sz + 2 * inc + sz * i / d, y(A) + sz)], i, 0, d)
list9 = Sequence(Segment[(x(A) + 2 * sz + 2 * inc + sz * i / d, y(A) + sz + inc), (x(A) + 2 * sz + 2 * inc + sz * i / d, y(A) + sz + sz + inc)], i, 0, d)
list10 = Sequence(Segment[(x(A) + 2 * sz + 2 * inc + sz * i / d, y(A) + 2 * sz + 2 * inc), (x(A) + 2 * sz + 2 * inc + sz * i / d, y(A) + sz + 2 * sz + 2 * inc)], i, 0, d)
list11 = Sequence(Segment[(x(A) + sz + inc + sz * i / d, y(A) + 2 * sz + 2 * inc), (x(A) + sz + inc + sz * i / d, y(A) + sz + 2 * sz + 2 * inc)], i, 0, d)
list12 = Sequence(Segment[(x(A) + sz + inc + sz * i / d, y(A) + sz + inc), (x(A) + sz + inc + sz * i / d, y(A) + sz + sz + inc)], i, 0, d)
list13 = Sequence(Segment[(x(A) + sz + inc, y(A) + i * sz), (x(A) + sz + inc + sz, y(A) + i * sz)], i, 0, 1)
list14 = Sequence(Segment[(x(A) + 2 * (sz + inc), y(A) + i * sz), (x(A) + 2 * (sz + inc) + sz, y(A) + i * sz)], i, 0, 1)
list15 = Sequence(Segment[(x(A) + sz + inc, y(A) + inc + sz + i * sz), (x(A) + sz + inc + sz, y(A) + inc + sz + i * sz)], i, 0, 1)
list16 = Sequence(Segment[(x(A) + 2 * (sz + inc), y(A) + inc + sz + i * sz), (x(A) + 2 * (sz + inc) + sz, y(A) + inc + sz + i * sz)], i, 0, 1)
list17 = Sequence(Segment[(x(A) + sz + inc, y(A) + 2 * (inc + sz) + i * sz), (x(A) + sz + inc + sz, y(A) + 2 * (inc + sz) + i * sz)], i, 0, 1)
list18 = Sequence(Segment[(x(A) + 2 * (sz + inc), y(A) + 2 * (inc + sz) + i * sz), (x(A) + 2 * (sz + inc) + sz, y(A) + 2 * (inc + sz) + i * sz)], i, 0, 1)
poly2, b_1, c_1, e_1, f_1 = Polygon((x(A) + sz + inc, y(A)), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A)), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A) + sz), (x(A) + sz + inc, y(A) + sz))
poly5, r, s, t, d_1 = Polygon(A, (x(A) + Min[c * sz / d, sz], y(A)), (x(A) + Min[c * sz / d, sz], y(A) + sz), (x(A), y(A) + sz))
s2: c ≥ 2 * d
poly3, g_1, h_1, i_1, j_1 = Polygon((x(A) + 2 * (sz + inc), y(A)), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A)), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A) + sz), (x(A) + 2 * (sz + inc), y(A) + sz))
u = false
poly4, a_2, k_1, l_1, m_1 = Polygon(A, (x(A) + Min[c * sz / d, sz], y(A)), (x(A) + Min[c * sz / d, sz], y(A) + Min[a * sz / b, sz]), (x(A), y(A) + Min[a * sz / b, sz]))
poly6, n_1, p_1, q_1, r_1 = Polygon((x(A) + sz + inc, y(A)), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A)), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A) + Min[a * sz / b, sz]), (x(A) + sz + inc, y(A) + Min[a * sz / b, sz]))
poly7, s_1, t_1, b_2, c_2 = Polygon((x(A) + 2 * (sz + inc), y(A)), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A)), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A) + Min[a * sz / b, sz]), (x(A) + 2 * (sz + inc), y(A) + Min[a * sz / b, sz]))
poly8, d_2, e_2, f_2, g_2 = Polygon((x(A), y(A) + sz + inc), (x(A) + Min[c * sz / d, sz], y(A) + sz + inc), (x(A) + Min[c * sz / d, sz], y(A) + sz + inc + g1 * Min[(a - b) * sz / b, sz]), (x(A), y(A) + sz + inc + g1 * Min[(a - b) * sz / b, sz]))
poly9, h_2, i_2, j_2, k_2 = Polygon((x(A) + sz + inc, y(A) + sz + inc), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A) + sz + inc), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A) + sz + inc + g1 * Min[(a - b) * sz / b, sz]), (x(A) + sz + inc, y(A) + sz + inc + g1 * Min[(a - b) * sz / b, sz]))
poly10, l_2, m_2, n_2, p_2 = Polygon((x(A) + 2 * (sz + inc), y(A) + sz + inc), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A) + sz + inc), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A) + sz + inc + g1 * Min[(a - b) * sz / b, sz]), (x(A) + 2 * (sz + inc), y(A) + sz + inc + g1 * Min[(a - b) * sz / b, sz]))
poly11, q_2, r_2, s_2, t_2 = Polygon((x(A), y(A) + 2 * (sz + inc)), (x(A) + Min[c * sz / d, sz], y(A) + 2 * (sz + inc)), (x(A) + Min[c * sz / d, sz], y(A) + 2 * (sz + inc) + g2 * Min[(a - 2 * b) * sz / b, sz]), (x(A), y(A) + 2 * (sz + inc) + g2 * Min[(a - 2 * b) * sz / b, sz]))
poly12, a_3, b_3, c_3, d_3 = Polygon((x(A) + sz + inc, y(A) + 2 * (sz + inc)), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A) + 2 * (sz + inc)), (x(A) + sz + inc + s1 * Min[(c - d) * sz / d, sz], y(A) + 2 * (sz + inc) + g2 * Min[(a - 2 * b) * sz / b, sz]), (x(A) + sz + inc, y(A) + 2 * (sz + inc) + g2 * Min[(a - 2 * b) * sz / b, sz]))
poly13, e_3, f_3, g_3, h_3 = Polygon((x(A) + 2 * (sz + inc), y(A) + 2 * (sz + inc)), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A) + 2 * (sz + inc)), (x(A) + 2 * (sz + inc) + s2 * Min[(c - 2 * d) * sz / d, sz], y(A) + 2 * (sz + inc) + g2 * Min[(a - 2 * b) * sz / b, sz]), (x(A) + 2 * (sz + inc), y(A) + 2 * (sz + inc) + g2 * Min[(a - 2 * b) * sz / b, sz]))
list19 = Sequence(Segment[(x(A) + sz + inc, y(A) + sz * i / b), (x(A) + sz + inc + sz, y(A) + sz * i / b)], i, 1, b - 1)
list20 = Sequence(Segment[(x(A) + sz + inc, y(A) + sz + inc + sz * i / b), (x(A) + sz + inc + sz, y(A) + sz + inc + sz * i / b)], i, 1, b - 1)
list21 = Sequence(Segment[(x(A) + sz + inc, y(A) + 2 * (sz + inc) + sz * i / b), (x(A) + sz + inc + sz, y(A) + 2 * (sz + inc) + sz * i / b)], i, 1, b - 1)
list22 = Sequence(Segment[(x(A) + 2 * (sz + inc), y(A) + sz * i / b), (x(A) + 2 * (sz + inc) + sz, y(A) + sz * i / b)], i, 1, b - 1)
list23 = Sequence(Segment[(x(A) + 2 * (sz + inc), y(A) + sz + inc + sz * i / b), (x(A) + 2 * (sz + inc) + sz, y(A) + sz + inc + sz * i / b)], i, 1, b - 1)
list24 = Sequence(Segment[(x(A) + 2 * (sz + inc), y(A) + 2 * (sz + inc) + sz * i / b), (x(A) + 2 * (sz + inc) + sz, y(A) + 2 * (sz + inc) + sz * i / b)], i, 1, b - 1)
text1: "$\frac{a}{b}=\frac{" + (LaTeX[a]) + "}{" + (LaTeX[b]) + "}$ units high"
text2: " $\frac{c}{d}=\frac{" + (LaTeX[c]) + "}{" + (LaTeX[d]) + "}$  units wide"