Skip to content

Instantly share code, notes, and snippets.

@Wqrld
Created July 20, 2022 22:17
Show Gist options
  • Save Wqrld/3e23922ad827d611e23a526d69b6035a to your computer and use it in GitHub Desktop.
Save Wqrld/3e23922ad827d611e23a526d69b6035a to your computer and use it in GitHub Desktop.
from manim import *
%%manim -qm -v WARNING PointMovingOnShapes
class PointMovingOnShapes(Scene):
def construct(self):
circle = Circle(radius=2, color=BLUE)
P = Arrow(ORIGIN, [2, 0, 0], buff=0)
Q = Arrow(ORIGIN, [0, -2, 0], buff=0)
S = Arrow(ORIGIN, [np.sqrt(2), -np.sqrt(2), 0], buff=0)
self.add(circle)
self.wait()
self.add(P)
self.add(Q)
self.play(
FadeIn(P, shift=DOWN),
FadeIn(Q, shift=DOWN),
)
self.add(Text('P').next_to(P.get_end(), RIGHT))
self.add(Text('Q').next_to(Q.get_end(), RIGHT))
self.wait()
self.add(S)
self.play(
FadeIn(S, shift=DOWN),
)
self.add(Text('S').next_to(S.get_end(), RIGHT))
self.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment