Thử Nghiệm

 avatar
unknown
python
4 years ago
947 B
4
Indexable
from manim import *


class FittingObjects(Scene):
    def construct(self):
        axes = Axes(
            x_range=[-3,3,1],
            y_range=[-3,3,1],
            x_length=6,
            y_length=6
        )
        axes.to_edge(LEFT, buff=0.5)
        # ---
        circle = Circle(
            stroke_width=6, 
            stroke_color =YELLOW,
            fill_color =RED_C,
            fill_opacity =0.8
            )
        circle.set_width(2).to_edge(DR, buff=0)

        tri = Triangle(
            stroke_color=ORANGE,
            stroke_width=3,
            fill_color=GREY
        ).set_height(2).shift(DOWN*3+RIGHT*3)
        tri.round_corners(0.02)
        # --- 
        self.add(NumberPlane())
        self.play( Write(axes))
        self.play(DrawBorderThenFill(circle))
        self.play(circle.animate.set_width(1))
        self.play(Transform(circle, tri), run_time =2)
        self.wait()
Editor is loading...