You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
640 B
21 lines
640 B
from manim import *
|
|
|
|
|
|
class PointWithTrace(Scene):
|
|
def construct(self):
|
|
path = VMobject()
|
|
dot = Dot()
|
|
path.set_points_as_corners([dot.get_center(), dot.get_center()])
|
|
|
|
def update_path(path):
|
|
previous_path = path.copy()
|
|
previous_path.add_points_as_corners([dot.get_center()])
|
|
path.become(previous_path)
|
|
path.add_updater(update_path)
|
|
self.add(path, dot)
|
|
self.play(Rotating(dot, radians=PI, about_point=RIGHT, run_time=2))
|
|
self.wait()
|
|
self.play(dot.animate.shift(UP))
|
|
self.play(dot.animate.shift(LEFT))
|
|
self.wait()
|