Last active
September 1, 2024 22:00
-
-
Save uwezi/61cd3cb250d097fdc2f96268bcb655b2 to your computer and use it in GitHub Desktop.
[always lambda] comparing functions and lambda functions. #manim #lambda #always_redraw #valuetracker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
class circles(Scene): | |
def construct(self): | |
vt = ValueTracker(1) | |
def mobfunc(): | |
return Circle(radius=vt.get_value(), color=BLUE).shift(3*LEFT) | |
circ1 = always_redraw(mobfunc) | |
circ2 = always_redraw(lambda: | |
Circle(radius=vt.get_value(),color=YELLOW).shift(3*RIGHT) | |
) | |
self.play(Create(circ1),Create(circ2)) | |
self.wait() | |
self.play(vt.animate.set_value(3)) | |
self.wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment