from manim import *
class CirclePointAtAngle(Scene):
    """3.3 point_at_angle(angle) 返回指定角度处圆上的坐标（弧度制）。
    0 度在最右侧，角度按逆时针增加；下面把 0 / 30 / 180 / 270 度四个点标出来。
    """
    def construct(self):
        title = Text("圆上取点 point_at_angle", font="STLiti", font_size=32).to_edge(UP)
        self.play(Write(title), run_time=0.8)
        c = Circle(radius=2.0, color=YELLOW)
        center = Dot(ORIGIN, color=GREY_B)
        self.play(Create(c), FadeIn(center), run_time=1.0)
        specs = [(0, "0 度", RIGHT), (PI / 6, "30 度", UR),
                 (PI, "180 度", LEFT), (3 * PI / 2, "270 度", DOWN)]
        pts, caps = VGroup(), VGroup()
        for ang, name, direction in specs:
            p = c.point_at_angle(ang)
            pts.add(Dot(p, color=BLUE))
            caps.add(Text(name, font="STLiti", font_size=22)
                     .next_to(p, direction, buff=0.18))
        self.play(LaggedStart(*[FadeIn(d) for d in pts], lag_ratio=0.3),
                  run_time=1.6)
        self.play(FadeIn(caps), run_time=0.6)
        self.wait(2.6)
