manim - 如何让多个点围绕一个圆圈匀速移动?
问题描述
我想在这里重现动画。
我发现了如何让多个点沿着一个圆圈移动,但它们只转一圈并且没有恒定的速度。
如何让它们以恒定速度移动并进行多次转弯?
这是我到目前为止的尝试:
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)
)
解决方案
刚刚找到答案,比我想象的要容易:
self.play(Rotating(points[0],
radians=2 * TAU,
about_point=ORIGIN),
Rotating(points[1],
radians=TAU,
about_point=ORIGIN),
)
推荐阅读
- nuget - Teamcity nuget依赖触发器失败
- sql - Pyspark sql 查询不工作,有问题的 group by
- python - TypeError: unsupported operand type(s) for &: 'str' and 'str' 如何解决
- openssl - Openssl C API 在 32 位中签名消息并在 64 位 Openssl 中验证签名
- sql - 如何编写仅在满足条件时才运行的 SQL 语句?
- android - 自动续订订阅的价格变化
- css - 限制 textarea 内部文本宽度但不限制滚动条
- ios - 在 iOS 13.1 beta 上收到 Voip 推送通知时,活动电话会终止
- python - 如何在 pandas 数据框中跳过“Nan”值以及如何在每个图上显示带有 rsquared 的回归线
- excel - 如何在VBA中用变量行填充一列公式