Пример #1
0
    def construct(self):
        line = NumberLine()
        self.add(line, *self.get_mobjects())
        offset = LEFT+DOWN
        vect = 2*RIGHT+UP
        dots = VMobject(*[
             Dot(offset + a*vect, radius = 0.075)
             for a in np.linspace(-2, 3, 18)
        ])
        dots.submobject_gradient_highlight(YELLOW_B, YELLOW_C)
        func = self.get_matrix_transformation(self.t_matrix)
        new_dots = VMobject(*[
            Dot(
                func(dot.get_center()), 
                color = dot.get_color(),
                radius = dot.radius
            )
            for dot in dots
        ])
        words = TextMobject(
            "Line of dots remains evenly spaced"
        )
        words.next_to(line, UP, buff = MED_SMALL_BUFF)

        self.play(Write(dots))
        self.apply_transposed_matrix(
            self.t_matrix,
            added_anims = [Transform(dots, new_dots)]
        )
        self.play(Write(words))
        self.dither()
Пример #2
0
    def construct(self):
        line = NumberLine()
        self.add(line, *self.get_mobjects())
        offset = LEFT+DOWN
        vect = 2*RIGHT+UP
        dots = VMobject(*[
             Dot(offset + a*vect, radius = 0.075)
             for a in np.linspace(-2, 3, 18)
        ])
        dots.submobject_gradient_highlight(YELLOW_B, YELLOW_C)
        func = self.get_matrix_transformation(self.t_matrix)
        new_dots = VMobject(*[
            Dot(
                func(dot.get_center()), 
                color = dot.get_color(),
                radius = dot.radius
            )
            for dot in dots
        ])
        words = TextMobject(
            "Line of dots remains evenly spaced"
        )
        words.next_to(line, UP, buff = MED_SMALL_BUFF)

        self.play(Write(dots))
        self.apply_transposed_matrix(
            self.t_matrix,
            added_anims = [Transform(dots, new_dots)]
        )
        self.play(Write(words))
        self.wait()
Пример #3
0
 def construct(self):
     word = TextMobject("``Parallelepiped''")
     word.scale(2)
     pp_part1 = VMobject(*word.split()[:len(word.split()) / 2])
     pp_part2 = VMobject(*word.split()[len(word.split()) / 2:])
     pp_part1.submobject_gradient_highlight(X_COLOR, Y_COLOR)
     pp_part2.submobject_gradient_highlight(Y_COLOR, Z_COLOR)
     self.play(Write(word))
     self.wait(2)
Пример #4
0
 def construct(self):
     word = TextMobject("``Parallelepiped''")
     word.scale(2)
     pp_part1 = VMobject(*word.split()[:len(word.split())/2])
     pp_part2 = VMobject(*word.split()[len(word.split())/2:])
     pp_part1.submobject_gradient_highlight(X_COLOR, Y_COLOR)
     pp_part2.submobject_gradient_highlight(Y_COLOR, Z_COLOR)
     self.play(Write(word))
     self.dither(2)
Пример #5
0
    def construct(self):
        icon = SVGMobject("video_icon")
        icon.center()
        icon.scale_to_fit_width(2 * SPACE_WIDTH / 12.)
        icon.set_stroke(color=WHITE, width=0)
        icon.set_fill(WHITE, opacity=1)
        icons = VMobject(*[icon.copy() for x in range(10)])
        icons.submobject_gradient_highlight(BLUE_A, BLUE_D)
        icons.arrange_submobjects(RIGHT)
        icons.to_edge(LEFT)

        self.play(FadeIn(icons, submobject_mode="lagged_start"), run_time=3)
        self.wait()
Пример #6
0
 def construct(self):
     self.lock_in_faded_grid()
     vectors = VMobject(*[
         Vector([x, y])
         for x in np.arange(-int(SPACE_WIDTH)+0.5, int(SPACE_WIDTH)+0.5)
         for y in np.arange(-int(SPACE_HEIGHT)+0.5, int(SPACE_HEIGHT)+0.5)
     ])
     vectors.submobject_gradient_highlight(PINK, BLUE_E)
     words = TextMobject("Span")
     words.scale(3)
     words.to_edge(UP)
     words.add_background_rectangle()
     self.add(vectors, words)
Пример #7
0
 def construct(self):
     self.lock_in_faded_grid()
     vectors = VMobject(*[
         Vector([x, y]) for x in np.arange(-int(SPACE_WIDTH) + 0.5,
                                           int(SPACE_WIDTH) + 0.5)
         for y in np.arange(-int(SPACE_HEIGHT) + 0.5,
                            int(SPACE_HEIGHT) + 0.5)
     ])
     vectors.submobject_gradient_highlight(PINK, BLUE_E)
     words = TextMobject("Span")
     words.scale(3)
     words.to_edge(UP)
     words.add_background_rectangle()
     self.add(vectors, words)
Пример #8
0
    def construct(self):
        icon = SVGMobject("video_icon")
        icon.center()
        icon.scale_to_fit_width(2*SPACE_WIDTH/12.)
        icon.set_stroke(color = WHITE, width = 0)
        icon.set_fill(WHITE, opacity = 1)
        icons = VMobject(*[icon.copy() for x in range(10)])
        icons.submobject_gradient_highlight(BLUE_A, BLUE_D)
        icons.arrange_submobjects(RIGHT)
        icons.to_edge(LEFT)

        self.play(
            FadeIn(icons, submobject_mode = "lagged_start"),
            run_time = 3
        )
        self.dither()
Пример #9
0
    def construct(self):
        matrix = Matrix([[1, 0, 0.5], [0.5, 1, 0], [1, 0, 1]])
        matrix.shift(3 * LEFT)
        matrix.highlight_columns(X_COLOR, Y_COLOR, Z_COLOR)
        det_text = get_det_text(matrix)
        eq = TexMobject("=")
        eq.next_to(det_text, RIGHT)
        words = TextMobject(["Volume of this\\\\", "parallelepiped"])
        pp = words.split()[1]
        pp_part1 = VMobject(*pp.split()[:len(pp.split()) / 2])
        pp_part2 = VMobject(*pp.split()[len(pp.split()) / 2:])
        pp_part1.submobject_gradient_highlight(X_COLOR, Y_COLOR)
        pp_part2.submobject_gradient_highlight(Y_COLOR, Z_COLOR)

        words.next_to(eq, RIGHT)

        self.play(Write(matrix))
        self.wait()
        self.play(Write(det_text), Write(words), Write(eq))
        self.wait()
Пример #10
0
    def construct(self):
        matrix = Matrix([[1, 0, 0.5], [0.5, 1, 0], [1, 0, 1]])
        matrix.shift(3*LEFT)
        matrix.highlight_columns(X_COLOR, Y_COLOR, Z_COLOR)
        det_text = get_det_text(matrix)
        eq = TexMobject("=")
        eq.next_to(det_text, RIGHT)
        words = TextMobject([
            "Volume of this\\\\",
            "parallelepiped"
        ])
        pp = words.split()[1]
        pp_part1 = VMobject(*pp.split()[:len(pp.split())/2])
        pp_part2 = VMobject(*pp.split()[len(pp.split())/2:])
        pp_part1.submobject_gradient_highlight(X_COLOR, Y_COLOR)
        pp_part2.submobject_gradient_highlight(Y_COLOR, Z_COLOR)

        words.next_to(eq, RIGHT)

        self.play(Write(matrix))
        self.dither()
        self.play(Write(det_text), Write(words), Write(eq))
        self.dither()