a = 7 (slider from 1 to 15, step 1)
b0 = 0.8 (slider from 0 to 1, step 0.1)
b: floor(1.0 + (a - 1.0) * b0)
v = 5 (slider from 1 to 10, step 1)
t = 0 (slider from 0 to 1, step 0.0010)
a1 = (5.196152422706632, 2.9999999999999996)
ListaA1 = Sequence(Object["a" + (s)], s, 1.0, 50.0)
O: a1
B2: O - (0.0, a)
fin = Min(Sequence[If[Element[ListaA1, s] ≟ B2, s, Length[ListaA1]], s, 1.0, Length[ListaA1]])
tt: 1.0 + (fin - 1.0) * t
listaSeg1 = Sequence(Sequence[Segment[O + (s; t), O - (0.0, a) + (s; t)], s, 0.0, b], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg2 = Sequence(Sequence[Segment[O - (0.0, s), O - (0.0, s) + (b; t)], s, 0.0, a], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg3 = Sequence(Sequence[Segment[O + (s; t), O - (0.0, s)], s, 0.0, b], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg4 = Sequence(Sequence[Segment[O + (b; t) - (0.0, s), O - (0.0, b + s)], s, 0.0, a - b], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg5 = Sequence(Sequence[Segment[O + (b; t) - (0.0, a - b + s), O + (s; t) - (0.0, a)], s, 0.0, b], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg6 = Sequence(Sequence[Segment[O + (s; t), O - (0.0, s)], s, 0.0, a], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg7 = Sequence(Sequence[Segment[O + (b; t) - (0.0, a - s), O - (0.0, a) + (b - s; t)], s, 0.0, a], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
listaSeg8 = Sequence(Sequence[Segment[O + (a + s; t), O + (s; t) - (0.0, a)], s, 0.0, b - a], t, 210.0°, 329.99999999999994°, 119.99999999999999°)
a2: a1 + (b; 210.0 * °)
A = (0.36, 5.62)
D: a1 - (0.0, a)
C: a2 + D - a1
paso: floor(tt)
ListaA = First(ListaA1, fin)
B: a2
a3 = Trasvasa(O, a, b, a1, a2)
a4 = Trasvasa(O, a, b, a2, a3)
a5 = Trasvasa(O, a, b, a3, a4)
a6 = Trasvasa(O, a, b, a4, a5)
a7 = Trasvasa(O, a, b, a5, a6)
a8 = Trasvasa(O, a, b, a6, a7)
a9 = Trasvasa(O, a, b, a7, a8)
a10 = Trasvasa(O, a, b, a8, a9)
a11 = Trasvasa(O, a, b, a9, a10)
a12 = Trasvasa(O, a, b, a10, a11)
a13 = Trasvasa(O, a, b, a11, a12)
a14 = Trasvasa(O, a, b, a12, a13)
a15 = Trasvasa(O, a, b, a13, a14)
a16 = Trasvasa(O, a, b, a14, a15)
a17 = Trasvasa(O, a, b, a15, a16)
a18 = Trasvasa(O, a, b, a16, a17)
a19 = Trasvasa(O, a, b, a17, a18)
a20 = Trasvasa(O, a, b, a18, a19)
a21 = Trasvasa(O, a, b, a19, a20)
a22 = Trasvasa(O, a, b, a20, a21)
a23 = Trasvasa(O, a, b, a21, a22)
a24 = Trasvasa(O, a, b, a22, a23)
a25 = Trasvasa(O, a, b, a23, a24)
a26 = Trasvasa(O, a, b, a24, a25)
a27 = Trasvasa(O, a, b, a25, a26)
a28 = Trasvasa(O, a, b, a26, a27)
a29 = Trasvasa(O, a, b, a27, a28)
a30 = Trasvasa(O, a, b, a28, a29)
a31 = Trasvasa(O, a, b, a29, a30)
a32 = Trasvasa(O, a, b, a30, a31)
a33 = Trasvasa(O, a, b, a31, a32)
a34 = Trasvasa(O, a, b, a32, a33)
a35 = Trasvasa(O, a, b, a33, a34)
a36 = Trasvasa(O, a, b, a34, a35)
a37 = Trasvasa(O, a, b, a35, a36)
a38 = Trasvasa(O, a, b, a36, a37)
a39 = Trasvasa(O, a, b, a37, a38)
a40 = Trasvasa(O, a, b, a38, a39)
a41 = Trasvasa(O, a, b, a39, a40)
a42 = Trasvasa(O, a, b, a40, a41)
a43 = Trasvasa(O, a, b, a41, a42)
a44 = Trasvasa(O, a, b, a42, a43)
a45 = Trasvasa(O, a, b, a43, a44)
a46 = Trasvasa(O, a, b, a44, a45)
a47 = Trasvasa(O, a, b, a45, a46)
a48 = Trasvasa(O, a, b, a46, a47)
a49 = Trasvasa(O, a, b, a47, a48)
a50 = Trasvasa(O, a, b, a48, a49)
lado2 = Segment(a1, a2)
tramosA = Sequence(Distance[Element[ListaA, s], Element[ListaA, s + 1.0]], s, 1.0, Length[ListaA] - 1.0)
lista1 = Sequence(Distance[Element[ListaA, s], Intersect[lado2, Line[Element[ListaA, s], Element[ListaA, s] + (0.0, 1.0)]]], s, 2.0, Min[Length[tramosA], paso])
lado1 = Segment(a1, D)
lista2 = Sequence(Distance[Element[ListaA, s], Intersect[lado1, Line[Element[ListaA, s], Element[ListaA, s] + (1.0; 210.0 * °)]]], s, 2.0, Min[Length[tramosA], paso])
lista0: a + b - lista1 - lista2
izq0 = Join({{a + b}, lista0})
izq1 = Join({{0.0}, lista1})
izq2 = Join({{0.0}, lista2})
Q1 = If(paso < fin, Element[ListaA, paso], Element[ListaA, fin])
Q2 = If(paso < fin - 1.0, Element[ListaA, paso + 1.0], Element[ListaA, fin])
Q: Q1 + (Q2 - Q1) * (tt - paso)
B1: O
ListaB1 = Sequence(O + (0.0, Distance[Element[ListaA, s], Intersect[lado2, Line[Element[ListaA, s], Element[ListaA, s] + (0.0, 1.0)]]] - a) + (abs(b - Distance[Element[ListaA, s], Intersect[lado1, Line[Element[ListaA, s], Element[ListaA, s] + (1.0; 210.0 * °)]]]); 330.0 * °), s, 3.0, Length[ListaA])
ListaB = Join({{B1}, {B2}, ListaB1})
P1 = If(paso < fin, Element[ListaB, paso], Element[ListaB, fin])
P2 = If(paso < fin - 1.0, Element[ListaB, paso + 1.0], Element[ListaB, fin])
P: P1 + (P2 - P1) * (tt - paso)
polígono1, o, b_1, c, d = Polygon(O, B, C, D)
O' = Mirror(O, lado1)
B' = Mirror(B, lado1)
C' = Mirror(C, lado1)
D' = Mirror(D, lado1)
polígono1', o', b', c', d' = Polygon(O', B', C', D')
texto1 = TableText({izq0, izq1, izq2}, "vr")
T = (0.78, 6.02)
guia1 = Line(A, xAxis)
guia2 = Line(T, guia1)
T01 = Point(guia1)
T01': T01 - (4.5, 0.0)
T02 = Point(guia1)
T02': T02 - (4.5, 0.0)
T03 = Point(guia1)
T03': T03 - (4.5, 0.0)
T04 = Point(guia2)
T04': T04 - (4.5, 0.0)
T05 = Point(guia2)
T05': T05 - (4.5, 0.0)
T06 = Point(guia2)
T06': T06 - (4.5, 0.0)
der0 = Join({{a + b}, a + b - lista0})
der1 = Join({{0.0}, a - lista1})
der2 = Join({{0.0}, b - lista2})
texto2 = TableText({der0, der1, der2}, "vr")
lado3 = Segment(a1, B')
coorX = Distance(P, Intersect[lado1, Line[P, P + (1.0; 330.0 * °)]])
coorY = Distance(P, Intersect[lado3, Line[P, P + (0.0, 1.0)]])
coorX' = Distance(Q, Intersect[lado1, Line[Q, Q + (1.0; 210.0 * °)]])
coorY' = Distance(Q, Intersect[lado2, Line[Q, Q + (0.0, 1.0)]])
Z01 = (5.54, 4.32)
Z01': Z01 - (4.5, 0.0)
Z02: Z01 + (0.75, 0.0)
Z02': Z02 - (4.5, 0.0)
Z03: Z01 + (0.0, 1.0)
Z03': Z03 - (4.5, 0.0)
Z04: Z02 + (0.0, 1.0)
Z04': Z04 - (4.5, 0.0)
Z05: Z01 + T05 - T04
Z06: Z02 + T05 - T04
Z06': Z06 - (4.5, 0.0)
Z05': Z05 - (4.5, 0.0)
Z07: Z05 + (0.0, a / (a + b))
Z07': Z07 - (4.5, 0.0)
Z08: Z06 + (0.0, a / (a + b))
Z08': Z08 - (4.5, 0.0)
Z09: Z05 + T06 - T05
Z09': Z09 - (4.5, 0.0)
Z10: Z06 + T06 - T05
Z10': Z10 - (4.5, 0.0)
Z11: Z09 + (0.0, b / (a + b))
Z11': Z11 - (4.5, 0.0)
Z12: Z10 + (0.0, b / (a + b))
Z12': Z12 - (4.5, 0.0)
v01 = Segment(Z03', Z01')
v02 = Segment(Z01', Z02')
v03 = Segment(Z02', Z04')
v04 = Segment(Z07', Z05')
v05 = Segment(Z05', Z06')
v06 = Segment(Z06', Z08')
v07 = Segment(Z11', Z09')
v08 = Segment(Z09', Z10')
v09 = Segment(Z10', Z12')
v10 = Segment(Z03, Z01)
v11 = Segment(Z01, Z02)
v12 = Segment(Z02, Z04)
v13 = Segment(Z07, Z05)
v14 = Segment(Z05, Z06)
v15 = Segment(Z06, Z08)
v16 = Segment(Z11, Z09)
v17 = Segment(Z09, Z10)
v18 = Segment(Z10, Z12)
N3': Z05' + (0.0, coorY' / (a + b))
N4': Z06' + (0.0, coorY' / (a + b))
N4: Z06 + (0.0, coorY / (a + b))
N3: Z05 + (0.0, coorY / (a + b))
N5: Z09 + (0.0, coorX / (a + b))
N5': Z09' + (0.0, coorX' / (a + b))
N6: Z10 + (0.0, coorX / (a + b))
N6': Z10' + (0.0, coorX' / (a + b))
N1: Z01 + (0.0, a / (a + b) - coorY / (a + b))
N2: Z02 + (0.0, a / (a + b) - coorY / (a + b))
M1: N1 + (0.0, b / (a + b) - coorX / (a + b))
M2: N2 + (0.0, b / (a + b) - coorX / (a + b))
N1': Z01' + (0.0, a / (a + b) - coorY' / (a + b))
N2': Z02' + (0.0, a / (a + b) - coorY' / (a + b))
M1': N1' + (0.0, b / (a + b) - coorX' / (a + b))
M2': N2' + (0.0, b / (a + b) - coorX' / (a + b))
polígono2, e, f, g, h = Polygon(N3, Z05, Z06, N4)
polígono3, n5, z09, z10, n6 = Polygon(N5, Z09, Z10, N6)
polígono4, n3', z05', z06', n4' = Polygon(N3', Z05', Z06', N4')
polígono5, n5', z09', z10', n6' = Polygon(N5', Z09', Z10', N6')
polígono6, z01, n1, n2, z02 = Polygon(Z01, N1, N2, Z02)
polígono7, z01', n1', n2', z02' = Polygon(Z01', N1', N2', Z02')
polígono8, n1_1, m1, m2, n2_1 = Polygon(N1, M1, M2, N2)
polígono9, n1'_1, m1', m2', n2'_1 = Polygon(N1', M1', M2', N2')
texto4 = Text("" + coorY, T02)
texto5 = Text("" + coorX, T03)
texto6 = Text("" + (a + b - coorX' - coorY'), T01')
texto7 = Text("" + coorY', T02')
texto8 = Text("" + coorX', T03')
texto9 = Text("Bidón", T04)
texto10 = Text("Jarra A", T05)
texto11 = Text("Jarra A", T05')
texto12 = Text("Jarra B", T06)
texto13 = Text("Jarra B", T06')
texto14 = Text("Bidón", T04')
texto3 = Text("" + (a + b - coorX - coorY), T01)
B2' = Mirror(B2, lado1)
A2' = Mirror(a2, lado1)
C'_1 = Mirror(C, lado1)
tramosB = Sequence(Distance[Element[ListaB, s], Element[ListaB, s + 1.0]], s, 1.0, Length[ListaB] - 1.0)
rastroA1 = Segment(Q1, Q)
rastroB1 = Segment(P1, P)
rastroA = Sequence(Segment[Element[ListaA, s - 1.0], Element[ListaA, s]], s, 2.0, paso)
rastroB = Sequence(Segment[Element[ListaB, s - 1.0], Element[ListaB, s]], s, 2.0, paso)
texto15: "b = " + b
texto16: "a = " + a
deslizadorMuestraBotonReproducir = 0 (slider from -5 to 5, step 0.1)

Tool: Trasvasa
O, a, b, Punto inicial, Punto contacto
Input: O, a, b, P, F
Output: E

p = Circle(F, 0.0010)
A2: O - (0.0, a)
l = Segment(O, A2)
C: O + (b; 210.0 * °)
k = Segment(O, C)
D: A2 + C - O
j = Segment(C, D)
g = Segment(A2, D)
lista2: {AffineRatio[O, A2, F], AffineRatio[A2, D, F], AffineRatio[O, C, F], AffineRatio[C, D, F]}
lista3 = Sequence(If[Defined[Element[lista2, s]], s, 0.0], s, 1.0, Length[lista2])
indicador = Max(lista3)
lista5: {A2, D, C, D}
lista4: {O, A2, O, C}
G = If(Element[lista4, indicador] ≟ F, Element[lista5, indicador], Element[lista4, indicador])
n = Line(F, G)
h = OrthogonalLine(F, n)
P' = Mirror(P, h)
i = Ray(F, P')
A, B = Intersect(p, i)
m = Ray(B, P')
lista1b = RemoveUndefined({Intersect[m, g], Intersect[m, k], Intersect[m, l], Intersect[m, j]})
lista1a = If(F ≟ O, {C}, {})
lista1 = Join({lista1a, lista1b})
E = Element(lista1, 1.0)