首页 > 解决方案 > 如何让多个点围绕一个圆圈匀速移动?

问题描述

我想在这里重现动画。

我发现了如何让多个点沿着一个圆圈移动,但它们只转一圈并且没有恒定的速度。

如何让它们以恒定速度移动并进行多次转弯?

这是我到目前为止的尝试:

def construct(self):
    circle = Circle()
    points = Group(*[Dot((1, 0, 0)) for _ in range(2)])
    self.add(circle)
    self.add(points)
    self.play(
              MoveAlongPath(points[0], circle, run_time=1),
              MoveAlongPath(points[1], circle, run_time=2)
              )

标签: manim

解决方案


刚刚找到答案,比我想象的要容易:

self.play(Rotating(points[0],
                   radians=2 * TAU,
                   about_point=ORIGIN),
          Rotating(points[1],
                   radians=TAU,
                   about_point=ORIGIN),
          )

推荐阅读