Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active September 1, 2024 22:00
Show Gist options
  • Save uwezi/61cd3cb250d097fdc2f96268bcb655b2 to your computer and use it in GitHub Desktop.
Save uwezi/61cd3cb250d097fdc2f96268bcb655b2 to your computer and use it in GitHub Desktop.
[always lambda] comparing functions and lambda functions. #manim #lambda #always_redraw #valuetracker
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