from manim import *
import numpy as np
def dot(pos, **kwargs):
    """简写，等价于 Dot(pos, **kwargs)"""
    return Dot(pos, **kwargs)
class PathAlongFunc(Scene):
    def construct(self):
        sc = self
        cos_func = FunctionGraph(
            lambda t: np.cos(t) + 0.5 * np.cos(7 * t) + (1 / 7) * np.cos(14 * t),
            color=RED,
        )
        self.play(*[FadeIn(_o) for _o in [cos_func]], run_time=1.0)
        d1 = dot(cos_func.get_start())
        sc.play(MoveAlongPath(d1, cos_func), rate_func=linear, run_time=3)
        self.wait(0.5)
        self.wait(1.10)