Last active
August 26, 2023 00:49
-
-
Save thomasnield/423040a82da114184c39eba75f2a4f70 to your computer and use it in GitHub Desktop.
Manim - Circle Trace
This file contains 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 * | |
import os | |
class CircleTraceTest(Scene): | |
def construct(self): | |
circle = Circle(radius=2) | |
self.add(circle) | |
vt = ValueTracker(0.0) | |
point: Dot = always_redraw(lambda: Dot(point=circle.point_from_proportion(vt.get_value()))) | |
tex = always_redraw(lambda: | |
DecimalNumber(vt.get_value(), num_decimal_places=1) \ | |
.move_to( | |
circle.point_from_proportion(vt.get_value())*1.3 | |
) | |
) | |
self.add(vt,tex,point) | |
self.wait() | |
self.play(vt.animate.set_value(1), run_time=3) | |
self.wait() | |
self.play(vt.animate.set_value(0), run_time=3) | |
self.wait() | |
if __name__ == "__main__": | |
os.system(r"manim -qh -v WARNING --disable_caching -o CircleTraceTest manim_circle_trace.py CircleTraceTest") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment