Exemple #1
0
    def construct(self):
        v_color = MAROON_C
        w_color = BLUE

        definition = TextMobject("""
            The ``span'' of $\\vec{\\textbf{v}}$ and 
            $\\vec{\\textbf{w}}$ is the \\\\ set of all their
            linear combinations.
        """)
        definition.scale_to_fit_width(2*SPACE_WIDTH-1)
        definition.to_edge(UP)
        def_mobs = np.array(definition.split())
        VMobject(*def_mobs[4:4+4]).highlight(PINK)
        VMobject(*def_mobs[11:11+2]).highlight(v_color)
        VMobject(*def_mobs[16:16+2]).highlight(w_color)
        VMobject(*def_mobs[-19:-1]).highlight(YELLOW)

        equation = TexMobject([
            "a", "\\vec{\\textbf{v}}", "+", "b", "\\vec{\\textbf{w}}"
        ])
        equation.arrange_submobjects(buff = 0.1, aligned_edge = DOWN)
        equation.split()[1].highlight(v_color)
        equation.split()[4].highlight(w_color)
        a, b = np.array(equation.split())[[0, 3]]
        equation.scale(2)
        equation.next_to(definition, DOWN, buff = 1)

        vary_words = TextMobject(
            "Let $a$ and $b$ vary \\\\ over all real numbers"
        )
        vary_words.scale(1.5)
        vary_words.next_to(equation, DOWN, buff = 2)
        arrows = [
            Arrow(vary_words, letter)
            for letter in a, b
        ]

        self.play(Write(definition))
        self.play(Write(equation))
        self.dither()
        self.play(
            FadeIn(vary_words),
            ShowCreation(VMobject(*arrows))
        )
        self.dither()
Exemple #2
0
    def construct(self):
        v_color = MAROON_C
        w_color = BLUE
        words = TextMobject([
            "``Linear combination'' of",
            "$\\vec{\\textbf{v}}$",
            "and",
            "$\\vec{\\textbf{w}}$"
        ])
        words.split()[1].highlight(v_color)
        words.split()[3].highlight(w_color)
        words.scale_to_fit_width(2*SPACE_WIDTH - 1)
        words.to_edge(UP)

        equation = TexMobject([
            "a", "\\vec{\\textbf{v}}", "+", "b", "\\vec{\\textbf{w}}"
        ])
        equation.arrange_submobjects(buff = 0.1, aligned_edge = DOWN)
        equation.split()[1].highlight(v_color)
        equation.split()[4].highlight(w_color)
        a, b = np.array(equation.split())[[0, 3]]
        equation.scale(2)
        equation.next_to(words, DOWN, buff = 1)

        scalars_word = TextMobject("Scalars")
        scalars_word.scale(1.5)
        scalars_word.next_to(equation, DOWN, buff = 2)
        arrows = [
            Arrow(scalars_word, letter)
            for letter in a, b
        ]

        self.add(equation)
        self.play(Write(words))
        self.play(
            ShowCreation(VMobject(*arrows)),
            Write(scalars_word)
        )
        self.dither(2)
Exemple #3
0
    def construct(self):
        v_color = MAROON_C
        w_color = BLUE

        definition = TextMobject("""
            The ``span'' of $\\vec{\\textbf{v}}$ and 
            $\\vec{\\textbf{w}}$ is the \\\\ set of all their
            linear combinations.
        """)
        definition.scale_to_fit_width(2 * SPACE_WIDTH - 1)
        definition.to_edge(UP)
        def_mobs = np.array(definition.split())
        VMobject(*def_mobs[4:4 + 4]).highlight(PINK)
        VMobject(*def_mobs[11:11 + 2]).highlight(v_color)
        VMobject(*def_mobs[16:16 + 2]).highlight(w_color)
        VMobject(*def_mobs[-19:-1]).highlight(YELLOW)

        equation = TexMobject(
            ["a", "\\vec{\\textbf{v}}", "+", "b", "\\vec{\\textbf{w}}"])
        equation.arrange_submobjects(buff=0.1, aligned_edge=DOWN)
        equation.split()[1].highlight(v_color)
        equation.split()[4].highlight(w_color)
        a, b = np.array(equation.split())[[0, 3]]
        equation.scale(2)
        equation.next_to(definition, DOWN, buff=1)

        vary_words = TextMobject(
            "Let $a$ and $b$ vary \\\\ over all real numbers")
        vary_words.scale(1.5)
        vary_words.next_to(equation, DOWN, buff=2)
        arrows = [Arrow(vary_words, letter) for letter in a, b]

        self.play(Write(definition))
        self.play(Write(equation))
        self.dither()
        self.play(FadeIn(vary_words), ShowCreation(VMobject(*arrows)))
        self.dither()
Exemple #4
0
    def construct(self):

        #self.force_skipping()

        bubble = SVGMobject(file_name = "thought_bubble",
                            initial_scale_factor = 0.31)
        bubble.set_color(WHITE)
        bubble.stretch(1.25, 0)
        bubble.to_corner(DOWN+RIGHT)
        self.play(ShowCreation(VGroup(*bubble[:2])))
        self.play(ShowCreation(bubble[2]))
        self.dither()

        subbubbles = self.make_fractal(bubble[-1], [0.8*LEFT, 0.8*RIGHT])
        self.play(ShowCreation(subbubbles, submobject_mode = "all_at_once", run_time = 2))
        self.dither()

        main_rect = Rectangle(width = 2*SPACE_WIDTH-1, height = 2*SPACE_HEIGHT-1)
        rect_template = main_rect.copy()
        rect_template.stretch_about_point(0.5, 1, rect_template.get_edge_center(UP))
        subrects = self.make_fractal(rect_template, [0.9*LEFT, 0.9*RIGHT], ratio = (0.45, 0.8, 0.6))

        self.play(ReplacementTransform(bubble[-1], main_rect),
                  ReplacementTransform(subbubbles, subrects),
                  bubble[0].behind_edge, DOWN,
                  bubble[1].behind_edge, DOWN,
                  run_time = 2)
        #self.dither()

        implications = TexMobject("\Rightarrow\Leftarrow")
        implications.arrange_submobjects(DOWN, buff = 0.5)
        implications.rotate(-np.pi/2)
        contradiction = VGroup(
            TexMobject("X\\in X"),
            implications,
            TexMobject("X\\not\\in X"),
        )
        contradiction.arrange_submobjects(DOWN)
        contradiction.to_corner(LEFT+DOWN, buff = 1)
        contradiction.shift(RIGHT)
        contradiction.add(implications[1])
        implications.remove(implications[1])

        self.revert_to_original_skipping_status()
        #self.dither()
        self.play(FadeIn(contradiction, submobject_mode = "lagged_start"))
        #self.dither()

        questionmarks = TextMobject("???")
        questionmarks.next_to(contradiction, buff = 0.5)
        #self.play(Write(questionmarks))
        #self.dither()
        #contradiction.add(questionmarks)

        cross = Cross().set_color(RED)
        cross.scale((
            contradiction.get_width() / cross.get_width(),
            contradiction.get_height() / cross.get_height(),
            1,
        ))
        cross.move_to(contradiction)

        title = TextMobject("Set Theory").scale(1.3).to_edge(UP)
        division = DashedLine(title.get_edge_center(DOWN) + 0.2*DOWN, SPACE_HEIGHT*DOWN)

        self.play(
            contradiction.highlight, DARK_GREY,
            ShowCreation(cross),
        )
        axioms = TextMobject("Axioms")
        axioms.next_to(division)
        self.play(Write(axioms))
        self.dither()

        left_rect, right_rect = [], []
        for rect in subrects:
            if rect.get_center()[0] < 0: left_rect.append(rect)
            else: right_rect.append(rect)

        left_rect = VGroup(*left_rect)
        right_rect = VGroup(*right_rect)

        self.play(FadeOut(VGroup(right_rect, main_rect, contradiction, cross)))
        self.play(
            ShowCreation(division),
            UnapplyMethod(title.behind_edge, UP),
            left_rect.to_edge, DOWN, 0.8,
        )
        self.dither()

        theory_of_infinity = TextMobject("Theory of Infinity").highlight(BLUE)
        foundations_of_mathematics = TextMobject("Foundations of\\\\ Mathematics",
                                                 alignment = "\\raggedright")
        theory_of_infinity.next_to(division, LEFT, aligned_edge = UP)
        foundations_of_mathematics.next_to(division, RIGHT, aligned_edge = UP)
        VGroup(theory_of_infinity, foundations_of_mathematics).shift(0.2*DOWN)

        self.play(FadeIn(theory_of_infinity), run_time = 2, submobject_mode = "lagged_start")
        self.dither()
        self.play(FadeIn(foundations_of_mathematics), run_time = 2, submobject_mode = "lagged_start")
        self.dither()