A community-maintained Python framework for creating mathematical animations.
Tweaks to Fourier behavior
Grant Sanderson4391c9147bf8
diff --git a/active_projects/diffyq/part2/fourier_series.py b/active_projects/diffyq/part2/fourier_series.pyindex 932b376e5..b734e7d31 100644--- a/active_projects/diffyq/part2/fourier_series.py+++ b/active_projects/diffyq/part2/fourier_series.py@@ -372,7 +372,7 @@ class FourierOfPiSymbol(FourierCirclesScene):return path-class FourierOfName(FourierOfPiSymbol):+class FourierOfName(FourierOfPiSymbol, MovingCameraScene):CONFIG = {"n_vectors": 100,"name_color": WHITE,@@ -390,6 +390,9 @@ class FourierOfName(FourierOfPiSymbol):if name.get_height() > max_height:name.set_height(max_height)+ frame = self.camera.frame+ frame.save_state()+vectors = VGroup(VectorizedPoint())circles = VGroup(VectorizedPoint())for path in name.family_members_with_points():@@ -416,6 +419,8 @@ class FourierOfName(FourierOfPiSymbol):self.play(Transform(vectors, static_vectors, remover=True),Transform(circles, static_circles, remover=True),+ frame.set_height, 1.5 * name.get_height(),+ frame.move_to, path,)self.add(new_vectors, new_circles)@@ -431,7 +436,9 @@ class FourierOfName(FourierOfPiSymbol):vectors = static_vectorscircles = static_circlesself.play(- FadeOut(vectors)+ FadeOut(vectors),+ Restore(frame),+ run_time=2)self.wait(3)