aboutsummaryrefslogtreecommitdiffstats
path: root/scenes/v14_gabriel.py
diff options
context:
space:
mode:
Diffstat (limited to 'scenes/v14_gabriel.py')
-rw-r--r--scenes/v14_gabriel.py82
1 files changed, 41 insertions, 41 deletions
diff --git a/scenes/v14_gabriel.py b/scenes/v14_gabriel.py
index 24a9621..2a36935 100644
--- a/scenes/v14_gabriel.py
+++ b/scenes/v14_gabriel.py
@@ -4,8 +4,8 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from manim import *
from tiktok import *
-XA, XB = 1.0, 7.4 # dominio de 1/x
-KX, KY = 1.00, 2.00 # escala a pantalla
+XA, XB = 1.0, 7.4 # domain of 1/x
+KX, KY = 1.00, 2.00 # scale to screen
X0S, CY = -3.75, 1.70
@@ -17,15 +17,15 @@ def sy(x):
return KY / x
-def rama(sig, n=160, **kw):
+def branch(next_one, n=160, **kw):
xs = np.linspace(XA, XB, n)
- pts = [[sx(x), CY + sig * sy(x), 0] for x in xs]
+ pts = [[sx(x), CY + next_one * sy(x), 0] for x in xs]
m = VMobject(**kw)
m.set_points_as_corners(pts)
return m
-def cuerpo(fill="#1E4E8C", op=0.55):
+def body_obj(fill="#1E4E8C", op=0.55):
xs = np.linspace(XA, XB, 160)
up = [[sx(x), CY + sy(x), 0] for x in xs]
dn = [[sx(x), CY - sy(x), 0] for x in reversed(xs)]
@@ -34,7 +34,7 @@ def cuerpo(fill="#1E4E8C", op=0.55):
return m
-def aros(n=9, col=CELESTE, op=0.55):
+def hoops(n=9, col=C_SKY, op=0.55):
xs = np.linspace(XA + 0.35, XB, n)
return VGroup(*[
Ellipse(width=0.34, height=2 * sy(x), stroke_width=3, stroke_opacity=op,
@@ -46,7 +46,7 @@ class Gabriel(TikTok):
def construct(self):
self.prepare()
- chip = self.chip("Paradoja del infinito", CELESTE)
+ chip = self.chip("Paradoja del infinito", C_SKY)
with self.beat(0) as b:
b.play(FadeIn(chip, shift=DOWN * 0.3), run_time=0.45)
@@ -54,37 +54,37 @@ class Gabriel(TikTok):
self.fit(Text("el cuerno de", font=FONT, font_size=50,
weight=BOLD, color=WHITE), 8.0),
self.fit(Text("GABRIEL", font=FONT, font_size=86,
- weight=BOLD, color=AMBAR), 8.0),
+ weight=BOLD, color=AMBER), 8.0),
).arrange(DOWN, buff=0.25).move_to(UP * 2.6)
b.play(FadeIn(t[0], shift=UP * 0.15), run_time=0.5)
b.play(FadeIn(t[1], scale=0.7), run_time=0.8)
- eje = Line([sx(XA) - 0.5, CY, 0], [sx(XB) + 0.35, CY, 0],
+ axis_obj = Line([sx(XA) - 0.5, CY, 0], [sx(XB) + 0.35, CY, 0],
stroke_width=3, color="#33405C")
with self.beat(1) as b:
b.play(t.animate.scale(0.5).move_to(UP * 5.3), run_time=0.5)
- f = MathTex(r"y = \frac{1}{x}", color=AMBAR).scale(1.35).move_to(DOWN * 2.4)
- up = rama(+1, stroke_color=AMBAR, stroke_width=6)
- b.play(FadeIn(eje), run_time=0.3)
+ f = MathTex(r"y = \frac{1}{x}", color=AMBER).scale(1.35).move_to(DOWN * 2.4)
+ up = branch(+1, stroke_color=AMBER, stroke_width=6)
+ b.play(FadeIn(axis_obj), run_time=0.3)
b.play(Create(up), run_time=0.9)
b.play(Write(f), run_time=0.7)
- body = cuerpo()
- low = rama(-1, stroke_color=AMBAR, stroke_width=6)
- ar = aros()
- boca = Ellipse(width=0.42, height=2 * sy(XA), stroke_width=6,
- color=AMBAR).move_to([sx(XA), CY, 0])
+ body = body_obj()
+ low = branch(-1, stroke_color=AMBER, stroke_width=6)
+ ar = hoops()
+ mouth = Ellipse(width=0.42, height=2 * sy(XA), stroke_width=6,
+ color=AMBER).move_to([sx(XA), CY, 0])
with self.beat(2) as b:
b.play(Create(low), run_time=0.6)
- b.play(FadeIn(body), FadeIn(boca), run_time=0.5)
+ b.play(FadeIn(body), FadeIn(mouth), run_time=0.5)
b.play(LaggedStart(*[Create(a) for a in ar], lag_ratio=0.15), run_time=0.9)
- inf = MathTex(r"\cdots \infty", color=GRIS).scale(1.0)
+ inf = MathTex(r"\cdots \infty", color=C_GRAY).scale(1.0)
inf.next_to([sx(XB), CY, 0], RIGHT, buff=0.2)
b.play(FadeIn(inf), run_time=0.4)
- horn = VGroup(eje, body, up, low, ar, boca, inf)
+ horn = VGroup(axis_obj, body, up, low, ar, mouth, inf)
with self.beat(3) as b:
b.play(FadeOut(f), run_time=0.25)
@@ -94,58 +94,58 @@ class Gabriel(TikTok):
with self.beat(4) as b:
b.play(FadeOut(q), run_time=0.25)
- lleno = cuerpo(fill=VERDE, op=0.85)
- b.play(FadeIn(lleno), run_time=0.7)
+ filled = body_obj(fill=C_GREEN, op=0.85)
+ b.play(FadeIn(filled), run_time=0.7)
v = MathTex(r"V = \pi\int_1^{\infty}\frac{dx}{x^2} = \pi",
- color=VERDE).scale(1.15).move_to(DOWN * 2.05)
+ color=C_GREEN).scale(1.15).move_to(DOWN * 2.05)
b.play(Write(v), run_time=1.1)
with self.beat(5) as b:
lt = self.fit(Text("≈ 3,14 litros y te sobra", font=FONT, font_size=48,
- weight=BOLD, color=VERDE), 8.2).move_to(DOWN * 2.90)
+ weight=BOLD, color=C_GREEN), 8.2).move_to(DOWN * 2.90)
b.play(FadeIn(lt, shift=UP * 0.15), run_time=0.7)
with self.beat(6) as b:
- b.play(FadeOut(VGroup(v, lt, lleno)), run_time=0.4)
+ b.play(FadeOut(VGroup(v, lt, filled)), run_time=0.4)
q2 = self.fit(Text("¿y pintarlo por fuera?", font=FONT, font_size=52,
weight=BOLD, color=WHITE), 8.2).move_to(DOWN * 2.3)
- b.play(up.animate.set_stroke(ROSA, 8), low.animate.set_stroke(ROSA, 8),
+ b.play(up.animate.set_stroke(C_PINK, 8), low.animate.set_stroke(C_PINK, 8),
run_time=0.6)
b.play(FadeIn(q2, shift=UP * 0.15), run_time=0.6)
with self.beat(7) as b:
b.play(FadeOut(q2), run_time=0.25)
a = MathTex(r"A > 2\pi\int_1^{\infty}\frac{dx}{x} = \infty",
- color=ROSA).scale(1.15).move_to(DOWN * 2.15)
+ color=C_PINK).scale(1.15).move_to(DOWN * 2.15)
b.play(Write(a), run_time=1.1)
- b.play(Flash(a, color=ROSA, line_length=0.5, num_lines=18,
+ b.play(Flash(a, color=C_PINK, line_length=0.5, num_lines=18,
flash_radius=2.4), run_time=0.7)
with self.beat(8) as b:
b.play(FadeOut(VGroup(a, horn)), run_time=0.45)
- def fila(txt, val, col):
+ def row(txt, val, col):
t1 = Text(txt, font=FONT, font_size=44, weight=BOLD, color=WHITE)
t2 = Text(val, font=FONT, font_size=56, weight=BOLD, color=col)
return VGroup(t1, t2).arrange(DOWN, buff=0.18)
- cmp = VGroup(fila("volumen", "π (finito)", VERDE),
- fila("superficie", "∞ (infinita)", ROSA)
+ cmp = VGroup(row("volumen", "π (finito)", C_GREEN),
+ row("superficie", "∞ (infinita)", C_PINK)
).arrange(DOWN, buff=0.75).move_to(UP * 2.4)
self.fit(cmp, 8.2)
b.play(FadeIn(cmp[0], shift=UP * 0.15), run_time=0.55)
b.play(FadeIn(cmp[1], shift=UP * 0.15), run_time=0.55)
- golpe = VGroup(
+ impact = VGroup(
self.fit(Text("lo llenás de pintura", font=FONT, font_size=48,
weight=BOLD, color=WHITE), 8.2),
self.fit(Text("pero no lo podés pintar", font=FONT, font_size=48,
- weight=BOLD, color=AMBAR), 8.2),
+ weight=BOLD, color=AMBER), 8.2),
).arrange(DOWN, buff=0.3).move_to(DOWN * 0.6)
- b.play(FadeIn(golpe, scale=0.85), run_time=0.8)
+ b.play(FadeIn(impact, scale=0.85), run_time=0.8)
with self.beat(9) as b:
- b.play(FadeOut(VGroup(cmp, golpe)), run_time=0.4)
+ b.play(FadeOut(VGroup(cmp, impact)), run_time=0.4)
tr = VGroup(
self.fit(Text("la trampa:", font=FONT, font_size=48,
- weight=BOLD, color=ROSA), 8.2),
+ weight=BOLD, color=C_PINK), 8.2),
self.fit(Text("la pintura real tiene", font=FONT, font_size=46,
weight=BOLD, color=WHITE), 8.2),
self.fit(Text("espesor. El cuerno", font=FONT, font_size=46,
@@ -158,15 +158,15 @@ class Gabriel(TikTok):
with self.beat(10) as b:
b.play(FadeOut(tr), run_time=0.35)
- cta = VGroup(
+ count_txt = VGroup(
self.fit(Text("con el infinito", font=FONT, font_size=52,
weight=BOLD, color=WHITE), 8.0),
self.fit(Text("la intuición se rompe", font=FONT, font_size=56,
- weight=BOLD, color=AMBAR), 8.0),
+ weight=BOLD, color=AMBER), 8.0),
).arrange(DOWN, buff=0.35).move_to(UP * 1.4)
- b.play(FadeIn(cta[0], shift=UP * 0.15), run_time=0.55)
- b.play(Write(cta[1]), run_time=0.9)
- b.play(Circumscribe(cta[1], color=AMBAR, buff=0.25, stroke_width=6),
+ b.play(FadeIn(count_txt[0], shift=UP * 0.15), run_time=0.55)
+ b.play(Write(count_txt[1]), run_time=0.9)
+ b.play(Circumscribe(count_txt[1], color=AMBER, buff=0.25, stroke_width=6),
run_time=0.8)
self.finish()