Exemplo n.º 1
0
    def construct(self):
        words = TexText("Change we can believe in")
        change = VMobject(*words.split()[:6])
        top = TOP(radius = 0.75)
        top.shift(change.get_right()-top.get_right())

        self.play(Write(words))
        self.play(
            FadeOut(change),
            GrowFromCenter(top)
        )
        self.wait(3)
Exemplo n.º 2
0
 def get_log_anim(self, center):
     O_log_n = Tex(["O(", "\\log(n)", ")"])
     O_log_n.shift(center)
     log_n = O_log_n.split()[1]
     #super hacky
     g = log_n.split()[2]
     for mob in g.submobjects:
         mob.is_subpath = False 
         mob.set_fill(BLACK, 1.0)
         log_n.add(mob)
     g.submobjects = []
     #end hack
     top = TOP(2, None, "n", radius = 0.75)
     top.set_width(log_n.get_width())
     top.shift(log_n.get_center())
     new_O_log_n = O_log_n.copy()
     new_O_log_n.submobjects[1] = top
     return Transform(O_log_n, new_O_log_n)
Exemplo n.º 3
0
 def get_exp_anim(self, center):
     epii = Tex("e^{\\pi i} = -1")
     epii.shift(center)
     top = TOP("e", "\\pi i", "-1", radius = 0.75)
     top.shift(center)
     e, pi, i, equals, minus, one = epii.split()
     ##hacky
     loop = e.submobjects[0]
     loop.is_subpath = False
     loop.set_fill(BLACK, 1.0)
     e.submobjects = []
     ##
     start = VMobject(
         equals,
         VMobject(e, loop), 
         VMobject(pi, i),
         VMobject(minus, one)
     )
     return Transform(start, top)