Fill vase

Change vase shape

Empty vase

Show Text

poly1, a, b, c, d, e = Polygon((-3, 0), (0, 0), (0, 0), (-3, 0), (-3, 0))
poly2, f, g, h, i, j = Polygon((-2, 1), (-0.7, 1), (-0.7, 1.6), (-2, 1.6), (-2, 1))
poly3, k, l, m, n, p = Polygon((-2, 2), (-0.7, 2), (-0.7, 2.6), (-2, 2.6), (-2, 2))
poly4, q, r, s, t, a_1 = Polygon((-3, 3), (0, 3), (0, 3.6), (-3, 3.6), (-3, 3))
A = PointIn(poly4)
B = PointIn(poly3)
C = PointIn(poly2)
D = PointIn(poly1)
O = (0, 0)
A' = Rotate(A, 270*°, O)
B' = Rotate(B, 270*°, O)
C' = Rotate(C, 270*°, O)
D' = Rotate(D, 270*°, O)
ceiling = FitPoly({D', C', B', A'}, 3)
ceiling1 = Function(ceiling, x(D'), x(A'))
ceiling1_1 = Rotate(ceiling1, 90*°, O)
ceiling1_2 = Mirror(ceiling1_1, yAxis)
A'_1 = Mirror(A, yAxis)
B'_1 = Mirror(B, yAxis)
C'_1 = Mirror(C, yAxis)
D'_1 = Mirror(D, yAxis)
top = Segment(A, A'_1)
bot = Segment(D, D'_1)
vol_v: (π * Integral[ceiling1(x)^(2), x(D'), x(A')])
water = 0 (slider from 0 to vol_v, step 0.1)
baselevel: y(D)
volfun = Integral(ceiling1(x)^(2))
hwaterroot, E = Root(volfun(x) - volfun(baselevel) - water / π)
hwater: x(hwaterroot)
waterlevel = Segment(((-1 * ceiling1(hwater)), hwater), (ceiling1(hwater), hwater))
radiusbase: abs(x(D))
radiustop: abs(x(A))
P1: (ceiling1(hwater), hwater)
P2: ((-1 * ceiling1(hwater)), hwater)
list6 = Sequence((ceiling1(i), i), i, x(D'), hwater, 0.01)
list3 = Sequence(((-1 * ceiling1(i)), i), i, hwater, x(D'), -0.01)
list1: {P1}
list2: {P2}
listall = Join({list1, list2, list3, list6, list1})
poly5 = Polygon(listall)
showp = false
showt = false
P: (water, hwater - y(D))
ellipse: (x / radiustop)^(2) + ((y - y(A)) / ((0.07 * radiustop)))^(2) = 1
ellipse_1: (x / radiusbase)^(2) + ((y - y(D)) / ((0.07 * radiusbase)))^(2) = 1
ellipse_2: (x / (waterlevel / 2))^(2) + ((y - hwater) / (((-0.07) * waterlevel / 2)))^(2) = 1
ellipse_3: (x / radiusbase)^(2) + ((y - y(D)) / ((0.07 * radiusbase)))^(2) = 1
ellipse_4: (x / (waterlevel / 2))^(2) + ((y - hwater) / (((-0.07) * waterlevel / 2)))^(2) = 1