Example #1
0
    def construct(self):
        europe = ImageMobject("Europe", use_cache = False)
        self.add(europe)
        self.freeze_background()

        mathematicians = [
            ("Newton", [-1.75, -0.75, 0]),
            ("Jacob_Bernoulli",[-0.75, -1.75, 0]),
            ("Ehrenfried_von_Tschirnhaus",[0.5, -0.5, 0]),
            ("Gottfried_Wilhelm_von_Leibniz",[0.2, -1.75, 0]),
            ("Guillaume_de_L'Hopital", [-1.75, -1.25, 0]),
        ]

        for name, point in mathematicians:
            man = ImageMobject(name, invert = False)
            if name == "Newton":
                name = "Isaac_Newton"
            name_mob = TextMobject(name.replace("_", " "))
            name_mob.to_corner(UP+LEFT, buff=0.75)
            self.add(name_mob)
            man.scale_to_fit_height(4)
            mobject = Point(man.get_corner(UP+LEFT))
            self.play(Transform(mobject, man))
            man.scale(0.2)
            man.shift(point)
            self.play(Transform(mobject, man))
            self.remove(name_mob)
    def construct(self):
        europe = ImageMobject("Europe", use_cache = False)
        self.add(europe)
        self.freeze_background()

        mathematicians = [
            ("Newton", [-1.75, -0.75, 0]),
            ("Jacob_Bernoulli",[-0.75, -1.75, 0]),
            ("Ehrenfried_von_Tschirnhaus",[0.5, -0.5, 0]),
            ("Gottfried_Wilhelm_von_Leibniz",[0.2, -1.75, 0]),
            ("Guillaume_de_L'Hopital", [-1.75, -1.25, 0]),
        ]

        for name, point in mathematicians:
            man = ImageMobject(name, invert = False)
            if name == "Newton":
                name = "Isaac_Newton"
            name_mob = TextMobject(name.replace("_", " "))
            name_mob.to_corner(UP+LEFT, buff=0.75)
            self.add(name_mob)
            man.scale_to_fit_height(4)
            mobject = Point(man.get_corner(UP+LEFT))
            self.play(Transform(mobject, man))
            man.scale(0.2)
            man.shift(point)
            self.play(Transform(mobject, man))
            self.remove(name_mob)
Example #3
0
    def construct(self):
        string = Vibrate(color = BLUE_D, run_time = 5)
        picture = ImageMobject("lion", invert = False)
        picture.scale(0.8)
        picture_copy = picture.copy()
        picture.sort_points(np.linalg.norm)
        string.mobject.sort_points(lambda p : -np.linalg.norm(p))

        self.add(picture)
        self.dither()
        self.play(Transform(
            picture, string.mobject,
            run_time = 3,
            rate_func = rush_into
        ))
        self.remove(picture)
        self.play(string)

        for mob in picture_copy, string.mobject:
            mob.sort_points(lambda p : np.linalg.norm(p)%1)

        self.play(Transform(
            string.mobject, picture_copy,
            run_time = 5,
            rate_func = rush_from
        ))
Example #4
0
    def construct(self):

        self.force_skipping()
        conversation = Conversation(self)
        conversation.add_bubble("A co sjednotit všechny ordinály?")
        self.revert_to_original_skipping_status()

        forti_pic = ImageMobject("BuraliForti1.jpg", use_cache = False)
        forti_pic.scale(0.43)
        forti_pic.to_corner(UP+LEFT)

        ordinal_class = OrdinalClass(color = BLUE).shift(UP)
        ordinal_class.next_to(forti_pic, coor_mask = X_MASK)
        num = 7
        subordinals = VGroup([ordinal_class.copy() for _ in range(num)])
        for subord, x in zip(subordinals, np.linspace(0.3, 1, num)):
            i = int(x*len(subord.line))
            subord.line.remove(*subord.line[i:])

        lines_dest = VGroup([subord.line for subord in subordinals]).copy()
        bars_dest = VGroup([subord.bars for subord in subordinals]).copy()
        subordinals.arrange_submobjects(UP, False, coor_mask = Y_MASK)
        subordinals.next_to(conversation.dialog, UP, coor_mask = Y_MASK)
        lines = VGroup([subord.line for subord in subordinals])
        bars = VGroup([subord.bars for subord in subordinals])

        self.wait_to(3)
        self.play(FadeIn(subordinals))
        self.wait_to(4.5)
        self.play(
            Transform(lines, lines_dest),
            Transform(bars, bars_dest),
        )
        self.remove(subordinals)
        self.add(ordinal_class)
        self.wait_to(6)
        conversation.add_bubble("Cesare Burali-Forti paradox")

        next_bar = ordinal_class.bars[0][0].copy().next_to(ordinal_class)
        next_bar.highlight(YELLOW)
        self.wait_to(9)
        self.play(ShowCreation(next_bar))

        brace = BraceText(VGroup(ordinal_class, next_bar), "Nový ordinál", UP)
        self.wait_to(15)
        self.play(brace.creation_anim())

        picture = VGroup(ordinal_class, brace, next_bar)
        picture.save_state()
        picture.next_to(forti_pic, coor_mask = X_MASK)

        self.wait_to(29)
        self.play(FadeIn(forti_pic))

        self.wait_to(49)
        self.play(*map(FadeOut, [
            picture,
            conversation.dialog,
            forti_pic,
        ]))
Example #5
0
    def construct(self):
        names = [
            "Johann_Bernoulli2", "Jacob_Bernoulli",
            "Gottfried_Wilhelm_von_Leibniz", "Newton"
        ]
        guys = [ImageMobject(name, invert=False) for name in names]
        johann = guys[0]
        johann.scale(0.8)
        pensive_johann = johann.copy()
        pensive_johann.scale(0.25)
        pensive_johann.to_corner(DOWN + LEFT)
        comparitive_johann = johann.copy()
        template = Square(side_length=2)
        comparitive_johann.replace(template)
        comparitive_johann.shift(UP + LEFT)
        greater_than = TexMobject(">")
        greater_than.next_to(comparitive_johann)
        for guy, name in zip(guys, names)[1:]:
            guy.replace(template)
            guy.next_to(greater_than)
            name_mob = TextMobject(name.replace("_", " "))
            name_mob.scale(0.5)
            name_mob.next_to(guy, DOWN)
            guy.name_mob = name_mob
            guy.sort_points(lambda p: np.dot(p, DOWN + RIGHT))
        bubble = ThoughtBubble(initial_width=12)
        bubble.stretch_to_fit_height(6)
        bubble.ingest_submobjects()
        bubble.pin_to(pensive_johann)
        bubble.shift(DOWN)
        point = Point(johann.get_corner(UP + RIGHT))
        upper_point = Point(comparitive_johann.get_corner(UP + RIGHT))
        lightbulb = ImageMobject("Lightbulb", invert=False)
        lightbulb.scale(0.1)
        lightbulb.sort_points(np.linalg.norm)
        lightbulb.next_to(upper_point, RIGHT)

        self.add(johann)
        self.wait()
        self.play(Transform(johann, pensive_johann),
                  Transform(point, bubble),
                  run_time=2)
        self.remove(point)
        self.add(bubble)
        weakling = guys[1]
        self.play(FadeIn(comparitive_johann), ShowCreation(greater_than),
                  FadeIn(weakling))
        self.wait(2)
        for guy in guys[2:]:
            self.play(DelayByOrder(Transform(weakling, upper_point)))
            self.play(FadeIn(guy), ShimmerIn(guy.name_mob))
            self.wait(3)
            self.remove(guy.name_mob)
            weakling = guy
        self.play(FadeOut(weakling), FadeOut(greater_than))
        self.play(ShowCreation(lightbulb))
        self.wait()
        self.play(FadeOut(comparitive_johann), FadeOut(lightbulb))
        self.play(ApplyMethod(Mobject(johann, bubble).scale, 10, run_time=3))
Example #6
0
    def construct(self):
        headphones = ImageMobject("Headphones.png")
        headphones.scale(0.1)
        headphones.stretch(2, 0)
        headphones.shift(1.2*UP+0.05*LEFT)
        headphones.highlight(GREY)
        randy = Randolph()

        self.add(randy, headphones)
        self.dither(2)
        self.play(ApplyMethod(randy.blink))
        self.dither(4)
Example #7
0
    def construct(self):
        old_newton = ImageMobject("Old_Newton", invert=False)
        old_newton.scale(0.8)
        self.add(old_newton)
        self.freeze_background()

        words = TextMobject("Note the displeasure")
        words.to_corner(UP + RIGHT)
        face_point = 1.8 * UP + 0.5 * LEFT
        arrow = Arrow(words.get_bottom(), face_point)

        self.play(ShimmerIn(words))
        self.play(ShowCreation(arrow))
        self.wait()
Example #8
0
    def construct(self):
        image = ImageMobject("lion", invert=False)
        image.scale(0.5)
        image.shift(2 * LEFT)

        self.add(image)
        for vect, num in zip([DOWN, RIGHT], [1, 2]):
            brace = Brace(image, vect)
            words_mob = TextMobject("Dimension %d" % num)
            words_mob.next_to(image, vect, buff=1)
            self.play(Transform(Point(brace.get_center()), brace),
                      ShimmerIn(words_mob),
                      run_time=2)
        self.dither()
Example #9
0
    def construct(self):
        old_newton = ImageMobject("Old_Newton", invert = False)
        old_newton.scale(0.8)
        self.add(old_newton)
        self.freeze_background()

        words = TextMobject("Note the displeasure")
        words.to_corner(UP+RIGHT)
        face_point = 1.8*UP+0.5*LEFT
        arrow = Arrow(words.get_bottom(), face_point)


        self.play(ShimmerIn(words))
        self.play(ShowCreation(arrow))
        self.dither()
Example #10
0
    def construct(self):
        image = ImageMobject("lion", invert = False)
        image.scale(0.5)
        image.shift(2*LEFT)

        self.add(image)
        for vect, num in zip([DOWN, RIGHT], [1, 2]):
            brace = Brace(image, vect)
            words_mob = TextMobject("Dimension %d"%num)
            words_mob.next_to(image, vect, buff = 1)
            self.play(
                Transform(Point(brace.get_center()), brace),
                ShimmerIn(words_mob), 
                run_time = 2
            )
        self.dither()
Example #11
0
    def construct(self):

        #self.force_skipping()

        title = TextMobject("Set","Theory")
        title.scale(1.3)
        title.to_edge(UP)
        self.add(title)
        self.dither()
        cantor = ImageMobject("Georg_Cantor2")
        cantor.scale(0.5)
        cantor_desc = TextMobject("Georg Cantor")
        cantor_desc.next_to(cantor, DOWN)
        VGroup(cantor, cantor_desc).to_corner(UP+RIGHT)
        self.add(cantor)
        self.play(FadeIn(cantor),
                  FadeIn(cantor_desc, submobject_mode = "lagged_start"))
        self.dither()
        studies0 = TextMobject("Study of","infinity")
        studies0[1].highlight(YELLOW)
        studies0.scale(1.3)
        studies0.shift(LEFT*cantor_desc.get_width()/2 + UP)
        self.play(FadeIn(studies0[0]), Write(studies0[1]))
        self.dither()

        studies1 = TextMobject("Study of","infinite","sets")
        studies1.scale(1.3)
        studies1.move_to(studies0)
        studies1[1].highlight(YELLOW)

        sets_ori = title[0].copy()
        s = studies1[-1][-1].copy()
        s.shift(sets_ori[-1].get_center() - studies1[-1][-2].get_center())
        s.set_fill(opacity = 0)
        sets_ori.add(s)
        studies0.add(sets_ori)
        self.play(ReplacementTransform(studies0, studies1))
        self.dither()

        self.play(studies1.next_to, title, DOWN,
                  FadeOut(cantor),
                  FadeOut(cantor_desc))
        
        self.dither()
Example #12
0
    def construct(self):
        clock = Circle(radius=2, color=WHITE)
        clock.add(Dot(ORIGIN))
        ticks = Mobject(*[
            Line(1.8 * vect, 2 * vect, color=GREY)
            for vect in compass_directions(12)
        ])
        clock.add(ticks)
        hour_hand = Line(ORIGIN, UP)
        minute_hand = Line(ORIGIN, 1.5 * UP)
        clock.add(hour_hand, minute_hand)
        clock.to_corner(UP + RIGHT)
        hour_hand.get_center = lambda: clock.get_center()
        minute_hand.get_center = lambda: clock.get_center()

        solution = ImageMobject("Newton_brachistochrone_solution2",
                                use_cache=False)
        solution.stroke_width = 3
        solution.highlight(GREY)
        solution.scale_to_fit_width(5)
        solution.to_corner(UP + RIGHT)
        newton = ImageMobject("Old_Newton", invert=False)
        newton.scale(0.8)
        phil_trans = TextMobject("Philosophical Transactions")
        rect = Rectangle(height=6, width=4.5, color=WHITE)
        rect.to_corner(UP + RIGHT)
        rect.shift(DOWN)
        phil_trans.scale_to_fit_width(0.8 * rect.get_width())
        phil_trans.next_to(Point(rect.get_top()), DOWN)
        new_solution = solution.copy()
        new_solution.scale_to_fit_width(phil_trans.get_width())
        new_solution.next_to(phil_trans, DOWN, buff=1)
        not_newton = TextMobject("-Totally not by Newton")
        not_newton.scale_to_fit_width(2.5)
        not_newton.next_to(new_solution, DOWN, aligned_edge=RIGHT)
        phil_trans.add(rect)

        newton_complaint = TextMobject([
            "``I do not love to be", " \\emph{dunned} ",
            "and teased by foreigners''"
        ],
                                       size="\\small")
        newton_complaint.to_edge(UP, buff=0.2)
        dunned = newton_complaint.split()[1]
        dunned.highlight()
        dunned_def = TextMobject(
            "(old timey term for making \\\\ demands on someone)")
        dunned_def.scale(0.7)
        dunned_def.next_to(phil_trans, LEFT)
        dunned_def.shift(2 * UP)
        dunned_arrow = Arrow(dunned_def, dunned)

        johann = ImageMobject("Johann_Bernoulli2", invert=False)
        johann.scale(0.4)
        johann.to_edge(LEFT)
        johann.shift(DOWN)
        johann_quote = TextMobject("``I recognize the lion by his claw''")
        johann_quote.next_to(johann, UP, aligned_edge=LEFT)

        self.play(ApplyMethod(newton.to_edge, LEFT))
        self.play(ShowCreation(clock))
        kwargs = {"axis": OUT, "rate_func": smooth}
        self.play(Rotating(hour_hand, radians=-2 * np.pi, **kwargs),
                  Rotating(minute_hand, radians=-12 * 2 * np.pi, **kwargs),
                  run_time=5)
        self.wait()
        self.clear()
        self.add(newton)
        clock.ingest_submobjects()
        self.play(Transform(clock, solution))
        self.remove(clock)
        self.add(solution)
        self.wait()
        self.play(FadeIn(phil_trans), Transform(solution, new_solution))
        self.wait()
        self.play(ShimmerIn(not_newton))
        phil_trans.add(solution, not_newton)
        self.wait()
        self.play(*map(ShimmerIn, newton_complaint.split()))
        self.wait()
        self.play(ShimmerIn(dunned_def), ShowCreation(dunned_arrow))
        self.wait()
        self.remove(dunned_def, dunned_arrow)
        self.play(FadeOut(newton_complaint))
        self.remove(newton_complaint)
        self.play(FadeOut(newton), GrowFromCenter(johann))
        self.remove(newton)
        self.wait()
        self.play(ShimmerIn(johann_quote))
        self.wait()
Example #13
0
    def construct(self):
        names = [
            "Johann_Bernoulli2",
            "Jacob_Bernoulli",
            "Gottfried_Wilhelm_von_Leibniz",
            "Newton"
        ]
        guys = [
            ImageMobject(name, invert = False)
            for name in names
        ]
        johann = guys[0]
        johann.scale(0.8)
        pensive_johann = johann.copy()
        pensive_johann.scale(0.25)
        pensive_johann.to_corner(DOWN+LEFT)
        comparitive_johann = johann.copy()
        template = Square(side_length = 2)
        comparitive_johann.replace(template)
        comparitive_johann.shift(UP+LEFT)
        greater_than = TexMobject(">")
        greater_than.next_to(comparitive_johann)
        for guy, name in zip(guys, names)[1:]:
            guy.replace(template)
            guy.next_to(greater_than)
            name_mob = TextMobject(name.replace("_", " "))
            name_mob.scale(0.5)
            name_mob.next_to(guy, DOWN)
            guy.name_mob = name_mob
            guy.sort_points(lambda p : np.dot(p, DOWN+RIGHT))
        bubble = ThoughtBubble(initial_width = 12)
        bubble.stretch_to_fit_height(6)
        bubble.ingest_submobjects()
        bubble.pin_to(pensive_johann)
        bubble.shift(DOWN)
        point = Point(johann.get_corner(UP+RIGHT))
        upper_point = Point(comparitive_johann.get_corner(UP+RIGHT))
        lightbulb = ImageMobject("Lightbulb", invert = False)
        lightbulb.scale(0.1)
        lightbulb.sort_points(np.linalg.norm)
        lightbulb.next_to(upper_point, RIGHT)

        self.add(johann)
        self.dither()
        self.play(
            Transform(johann, pensive_johann),
            Transform(point, bubble),
            run_time = 2
        )
        self.remove(point)
        self.add(bubble)
        weakling = guys[1]        
        self.play(
            FadeIn(comparitive_johann),
            ShowCreation(greater_than),
            FadeIn(weakling)
        )
        self.dither(2)
        for guy in guys[2:]:
            self.play(DelayByOrder(Transform(
                weakling, upper_point
            )))
            self.play(
                FadeIn(guy),
                ShimmerIn(guy.name_mob)
            )
            self.dither(3)
            self.remove(guy.name_mob)
            weakling = guy
        self.play(FadeOut(weakling), FadeOut(greater_than))
        self.play(ShowCreation(lightbulb))
        self.dither()
        self.play(FadeOut(comparitive_johann), FadeOut(lightbulb))
        self.play(ApplyMethod(
            Mobject(johann, bubble).scale, 10,
            run_time = 3
        ))
Example #14
0
    def construct(self):
        clock = Circle(radius = 2, color = WHITE)
        clock.add(Dot(ORIGIN))
        ticks = Mobject(*[
            Line(1.8*vect, 2*vect, color = GREY)
            for vect in compass_directions(12)
        ])
        clock.add(ticks)
        hour_hand = Line(ORIGIN, UP)
        minute_hand = Line(ORIGIN, 1.5*UP)
        clock.add(hour_hand, minute_hand)
        clock.to_corner(UP+RIGHT)
        hour_hand.get_center = lambda : clock.get_center()
        minute_hand.get_center = lambda : clock.get_center()
 
        solution = ImageMobject(
            "Newton_brachistochrone_solution2",
            use_cache = False
        )
        solution.stroke_width = 3
        solution.highlight(GREY)
        solution.scale_to_fit_width(5)
        solution.to_corner(UP+RIGHT)
        newton = ImageMobject("Old_Newton", invert = False)
        newton.scale(0.8)
        phil_trans = TextMobject("Philosophical Transactions")
        rect = Rectangle(height = 6, width = 4.5, color = WHITE)
        rect.to_corner(UP+RIGHT)
        rect.shift(DOWN)
        phil_trans.scale_to_fit_width(0.8*rect.get_width())
        phil_trans.next_to(Point(rect.get_top()), DOWN)
        new_solution = solution.copy()
        new_solution.scale_to_fit_width(phil_trans.get_width())
        new_solution.next_to(phil_trans, DOWN, buff = 1)
        not_newton = TextMobject("-Totally not by Newton")
        not_newton.scale_to_fit_width(2.5)
        not_newton.next_to(new_solution, DOWN, aligned_edge = RIGHT)
        phil_trans.add(rect)

        newton_complaint = TextMobject([
            "``I do not love to be",
            " \\emph{dunned} ",
            "and teased by foreigners''"
        ], size = "\\small")
        newton_complaint.to_edge(UP, buff = 0.2)
        dunned = newton_complaint.split()[1]
        dunned.highlight()
        dunned_def = TextMobject("(old timey term for making \\\\ demands on someone)")
        dunned_def.scale(0.7)
        dunned_def.next_to(phil_trans, LEFT)
        dunned_def.shift(2*UP)
        dunned_arrow = Arrow(dunned_def, dunned)

        johann = ImageMobject("Johann_Bernoulli2", invert = False)
        johann.scale(0.4)
        johann.to_edge(LEFT)
        johann.shift(DOWN)
        johann_quote = TextMobject("``I recognize the lion by his claw''")
        johann_quote.next_to(johann, UP, aligned_edge = LEFT)

        self.play(ApplyMethod(newton.to_edge, LEFT))
        self.play(ShowCreation(clock))
        kwargs = {
            "axis" : OUT,
            "rate_func" : smooth
        }
        self.play(
            Rotating(hour_hand, radians = -2*np.pi, **kwargs),
            Rotating(minute_hand, radians = -12*2*np.pi, **kwargs),
            run_time = 5
        )
        self.dither()
        self.clear()
        self.add(newton)
        clock.ingest_submobjects()
        self.play(Transform(clock, solution))
        self.remove(clock)
        self.add(solution)
        self.dither()
        self.play(
            FadeIn(phil_trans),
            Transform(solution, new_solution)
        )
        self.dither()
        self.play(ShimmerIn(not_newton))
        phil_trans.add(solution, not_newton)
        self.dither()
        self.play(*map(ShimmerIn, newton_complaint.split()))
        self.dither()
        self.play(
            ShimmerIn(dunned_def),
            ShowCreation(dunned_arrow)
        )
        self.dither()
        self.remove(dunned_def, dunned_arrow)
        self.play(FadeOut(newton_complaint))
        self.remove(newton_complaint)
        self.play(
            FadeOut(newton),
            GrowFromCenter(johann)
        )
        self.remove(newton)        
        self.dither()
        self.play(ShimmerIn(johann_quote))
        self.dither()