コード例 #1
0
 def get_axis_labels(self, x_label="x", y_label="y"):
     x_axis, y_axis = self.get_axes().split()
     quads = [
         (x_axis, x_label, UP, RIGHT),
         (y_axis, y_label, RIGHT, UP),
     ]
     labels = VGroup()
     for axis, tex, vect, edge in quads:
         label = TexMobject(tex)
         label.add_background_rectangle()
         label.next_to(axis, vect)
         label.to_edge(edge)
         labels.add(label)
     self.axis_labels = labels
     return labels
コード例 #2
0
 def get_axis_labels(self, x_label="x", y_label="y"):
     x_axis, y_axis = self.get_axes().split()
     quads = [
         (x_axis, x_label, UP, RIGHT),
         (y_axis, y_label, RIGHT, UP),
     ]
     labels = VGroup()
     for axis, tex, vect, edge in quads:
         label = TexMobject(tex)
         label.add_background_rectangle()
         label.next_to(axis, vect)
         label.to_edge(edge)
         labels.add(label)
     self.axis_labels = labels
     return labels
コード例 #3
0
    def reveal_2_is_4(self):
        sqrt2_towers = VGroup(*[
            ExpTower(element = "\\sqrt{2}", order = 5).match_height(x_tower) \
                .move_to(x_tower, aligned_edge = RIGHT)
            for x_tower in self.x_towers
        ])
        self.play(
            Transform(self.x_towers, sqrt2_towers, submobject_mode = "lagged_start"),
            run_time = 2,
        )
        self.wait()
        self.play(FadeOut(self.rss))
        self.wait()

        two_equals_four = TexMobject("2", "=", "4")
        for tex, color in zip(two_equals_four, [GREEN, WHITE, RED]):
            tex.set_color(color)
        two_equals_four.scale(3)
        two_equals_four.to_edge(DOWN, buff = 1)
        sources = VGroup(*[
            self.equations[i][j][k].copy()
            for i, j, k in [(0, 1, 1), (1, 1, 0), (1, 1, 1)]
        ])
        for source, target in zip(sources, two_equals_four):
            self.play(Transform(source, target))
        self.wait()

        fake_qed = FakeQEDSymbol(order = 2, jagged_percentage = 0.3)
        fake_qed.next_to(two_equals_four, RIGHT, aligned_edge = DOWN, buff = 1)
        self.play(FadeIn(fake_qed))
        self.wait()

        issue = TextMobject("思考:\\\\问题在哪?")
        issue.set_color(YELLOW)
        issue.to_corner(RIGHT+DOWN)
        self.play(Write(issue), run_time = 1)
        self.wait(2)