Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

MoveAlongPath for docs (#873)

kolibril1333f20f4e2750
diff --git a/manim/animation/movement.py b/manim/animation/movement.py
index 76581928c..a8fa283c1 100644
--- a/manim/animation/movement.py
+++ b/manim/animation/movement.py
@@ -69,7 +69,7 @@ class ComplexHomotopy(Homotopy):
**kwargs
) -> None:
"""
- Complex Hootopy a function Cx[0, 1] to C
+ Complex Homotopy a function Cx[0, 1] to C
"""
def homotopy(
@@ -110,6 +110,21 @@ class PhaseFlow(Animation):
class MoveAlongPath(Animation):
+ """Make one mobject move along the path of another mobject.
+ Example
+ --------
+ .. manim:: MoveAlongPathExample
+
+ class MoveAlongPathExample(Scene):
+ def construct(self):
+ d1 = Dot().set_color(ORANGE)
+ l1 = Line(LEFT, RIGHT)
+ l2 = VMobject()
+ self.add(d1, l1, l2)
+ l2.add_updater(lambda x: x.become(Line(LEFT, d1.get_center()).set_color(ORANGE)))
+ self.play(MoveAlongPath(d1, l1), rate_func=linear)
+ """
+
def __init__(
self,
mobject: "Mobject",