Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active March 19, 2023 12:04
Show Gist options
  • Save uwezi/86bd92ea962533da55860cbedaddafe5 to your computer and use it in GitHub Desktop.
Save uwezi/86bd92ea962533da55860cbedaddafe5 to your computer and use it in GitHub Desktop.
[display angle value animated] How to display the value of an angle not using updaters #manim #angle #decimalnumber #loop #noupdater #animate
# https://discord.com/channels/581738731934056449/1020039781276721234/1020193585305505882
from manim import *
class smoother(Scene):
def construct(self):
line1 = Line(ORIGIN, RIGHT+(1/3)*DOWN)
line2 = Line(ORIGIN, UP+(1/3)*LEFT)
angle = Angle(line1, line2, radius=0.4)
value = DecimalNumber(angle.get_value(degrees=True), unit="^{\circ}")
value.next_to(angle, UR)
self.play(Create(line1), Create(line2), Create(angle), Create(value))
for a in np.arange(0,360,1):
line1.rotate(1*DEGREES, about_point=line1.start)
self.remove(angle)
angle = Angle(line1, line2, radius=0.4)
self.add(angle)
value.become(DecimalNumber(angle.get_value(degrees=True), unit="^{\circ}").next_to(angle, UR))
self.wait(1/10)
self.wait(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment