from manim import *
FONT = "STLiti"
class Demo(Scene):
    def construct(self):
        head = Text("根据两点生成圆弧：", font=FONT, font_size=36, color=YELLOW).to_edge(UP, buff=0.5)
        bar = Line(LEFT * 6.6, RIGHT * 6.6, color=BLUE).next_to(head, DOWN, buff=0.12)
        self.play(FadeIn(head), Create(bar), run_time=0.6)
        cfgs = [{"radius": 0.8}, {"radius": 1.6},
                {"angle": PI / 2}, {"angle": PI}]
        hues = [YELLOW, GREEN, YELLOW, GREEN]
        cells = VGroup()
        for cfg, col in zip(cfgs, hues):
            start = Dot(LEFT * 0.6, color=BLUE, radius=0.09)
            end = Dot(RIGHT * 0.6, color=RED, radius=0.09)
            arc = ArcBetweenPoints(start.get_center(), end.get_center(),
                                   color=col, stroke_width=6, **cfg)
            cells.add(VGroup(start, end, arc))
        cells.arrange_in_grid(rows=2, cols=2, buff=(1.6, 1.2)).shift(DOWN * 0.4)
        for cell in cells:
            self.play(FadeIn(cell), run_time=0.6)
        self.wait(2.6)
