A community-maintained Python framework for creating mathematical animations.
Mutliple VauleTracker example for docs (#1342)
kolibril1357a76db67862
diff --git a/docs/source/examples.rst b/docs/source/examples.rstindex dfcdbf1cc..4ef888b6f 100644--- a/docs/source/examples.rst+++ b/docs/source/examples.rst@@ -175,7 +175,26 @@ Animationsself.play(te.animate.set_color(RED), run_time=0.5)self.play(theta_tracker.animate.set_value(350))+.. tip::++ You can use multiple ValueTrackers simultaneously.++.. manim:: MovingDots+ class MovingDots(Scene):+ def construct(self):+ d1,d2=Dot(color=BLUE),Dot(color=GREEN)+ dg=VGroup(d1,d2).arrange(RIGHT,buff=1)+ l1=Line(d1.get_center(),d2.get_center()).set_color(RED)+ x=ValueTracker(0)+ y=ValueTracker(0)+ d1.add_updater(lambda z: z.set_x(x.get_value()))+ d2.add_updater(lambda z: z.set_y(y.get_value()))+ l1.add_updater(lambda z: z.become(Line(d1.get_center(),d2.get_center())))+ self.add(d1,d2,l1)+ self.play(x.animate.set_value(5))+ self.play(y.animate.set_value(4))+ self.wait().. manim:: MovingGroupToDestination