Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Final hilbert tweaks

Grant Sanderson0af9b3005cb6
diff --git a/hilbert/section1.py b/hilbert/section1.py
index 26b22bcbf..0f1244c13 100644
--- a/hilbert/section1.py
+++ b/hilbert/section1.py
@@ -947,7 +947,7 @@ class HilbertBetterThanSnakeQ(Scene):
class ImagineItWorks(Scene):
def construct(self):
- self.add(TextMobject("Image your project succeeds..."))
+ self.add(TextMobject("Imagine your project succeeds..."))
self.dither()
diff --git a/hilbert/section2.py b/hilbert/section2.py
index 5057be715..35a885dee 100644
--- a/hilbert/section2.py
+++ b/hilbert/section2.py
@@ -1037,6 +1037,57 @@ class TilingSpace(Scene):
rate_func = None,
run_time = 15
))
+
+
+class ColorIntervals(Scene):
+ def construct(self):
+ number_line = NumberLine(
+ numerical_radius = 5,
+ number_at_center = 5,
+ leftmost_tick = 0,
+ density = 2*DEFAULT_POINT_DENSITY_1D
+ )
+ number_line.shift(2*RIGHT)
+ number_line.add_numbers()
+ number_line.scale(2)
+ brace = Brace(Mobject(
+ *number_line.sub_mobjects[:2]
+ ))
+
+ self.add(number_line)
+ for n in range(0, 10, 2):
+ if n == 0:
+ brace_anim = GrowFromCenter(brace)
+ else:
+ brace_anim = ApplyMethod(brace.shift, 2*RIGHT)
+ self.play(
+ ApplyMethod(
+ number_line.highlight,
+ RED,
+ lambda p : p[0] > n-6.2 and p[0] < n-4 and p[1] > -0.4
+ ),
+ brace_anim
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+