from manim import *
class TracedPathDemo(Scene):
    def construct(self):
        head = Text("TracedPath: record the moving dot", font="Consolas", font_size=26, color=YELLOW).to_corner(UL, buff=0.4)
        d = Dot(RIGHT * 2, color=WHITE, radius=0.10)
        path = TracedPath(d.get_center, stroke_color=WHITE, stroke_width=4)
        self.add(head, d, path)
        self.play(d.animate(path_arc=PI / 4).shift(LEFT * 2), run_time=2.0)
        self.play(d.animate(path_arc=-PI / 4).shift(LEFT * 2), run_time=2.0)
        self.wait(1.6)
