manim-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +104 -0
  2. package/dist/demo.mp4 +0 -0
  3. package/dist/index.js +65 -0
  4. package/dist/mcp-app.html +142 -0
  5. package/dist/server.js +1492 -0
  6. package/package.json +67 -0
  7. package/references/composer/SKILL.md +154 -0
  8. package/references/composer/references/3b1b-series-patterns.md +217 -0
  9. package/references/composer/references/domain-planning-guides/calculus-planning.md +188 -0
  10. package/references/composer/references/domain-planning-guides/linear-algebra-planning.md +169 -0
  11. package/references/composer/references/domain-planning-guides/ml-planning.md +286 -0
  12. package/references/composer/references/domain-planning-guides/number-theory-planning.md +187 -0
  13. package/references/composer/references/domain-planning-guides/physics-planning.md +249 -0
  14. package/references/composer/references/domain-planning-guides/probability-planning.md +200 -0
  15. package/references/composer/references/mathematical-storytelling.md +359 -0
  16. package/references/composer/references/narrative-patterns.md +221 -0
  17. package/references/composer/references/opening-patterns.md +284 -0
  18. package/references/composer/references/pacing-guide.md +289 -0
  19. package/references/composer/references/scene-archetypes.md +534 -0
  20. package/references/composer/references/scene-examples.md +379 -0
  21. package/references/composer/references/visual-techniques.md +480 -0
  22. package/references/composer/templates/scenes-template.md +147 -0
  23. package/references/manimce/SKILL.md +166 -0
  24. package/references/manimce/examples/3d_visualization.py +373 -0
  25. package/references/manimce/examples/basic_animations.py +212 -0
  26. package/references/manimce/examples/graph_plotting.py +401 -0
  27. package/references/manimce/examples/lorenz_attractor.py +172 -0
  28. package/references/manimce/examples/math_visualization.py +315 -0
  29. package/references/manimce/examples/updater_patterns.py +369 -0
  30. package/references/manimce/rules/3b1b-translation.md +594 -0
  31. package/references/manimce/rules/3d.md +254 -0
  32. package/references/manimce/rules/advanced-animations.md +594 -0
  33. package/references/manimce/rules/animation-groups.md +212 -0
  34. package/references/manimce/rules/animations.md +128 -0
  35. package/references/manimce/rules/api-pitfalls.md +89 -0
  36. package/references/manimce/rules/axes.md +214 -0
  37. package/references/manimce/rules/camera.md +208 -0
  38. package/references/manimce/rules/cli.md +232 -0
  39. package/references/manimce/rules/color-conventions.md +444 -0
  40. package/references/manimce/rules/colors.md +199 -0
  41. package/references/manimce/rules/config.md +264 -0
  42. package/references/manimce/rules/creation-animations.md +158 -0
  43. package/references/manimce/rules/graphing.md +233 -0
  44. package/references/manimce/rules/grouping.md +220 -0
  45. package/references/manimce/rules/latex.md +202 -0
  46. package/references/manimce/rules/lines.md +241 -0
  47. package/references/manimce/rules/long-form-video.md +552 -0
  48. package/references/manimce/rules/mathematical-domains.md +689 -0
  49. package/references/manimce/rules/mobjects.md +116 -0
  50. package/references/manimce/rules/multi-scene-composition.md +112 -0
  51. package/references/manimce/rules/pedagogy.md +532 -0
  52. package/references/manimce/rules/physics-simulations.md +610 -0
  53. package/references/manimce/rules/positioning.md +211 -0
  54. package/references/manimce/rules/scenes.md +121 -0
  55. package/references/manimce/rules/shapes.md +300 -0
  56. package/references/manimce/rules/styling.md +177 -0
  57. package/references/manimce/rules/text-animations.md +222 -0
  58. package/references/manimce/rules/text.md +189 -0
  59. package/references/manimce/rules/timing.md +227 -0
  60. package/references/manimce/rules/transform-animations.md +157 -0
  61. package/references/manimce/rules/updaters.md +226 -0
  62. package/references/manimce/templates/basic_scene.py +64 -0
  63. package/references/manimce/templates/camera_scene.py +100 -0
  64. package/references/manimce/templates/threed_scene.py +138 -0
@@ -0,0 +1,359 @@
1
+ # Mathematical Storytelling in 3Blue1Brown Style
2
+
3
+ The narrative craft behind 3b1b videos, extracted from 400+ video source files. This is not about animation technique -- it's about how to STRUCTURE the intellectual journey so viewers have genuine "aha moments."
4
+
5
+ ---
6
+
7
+ ## Principle 1: Start with a QUESTION, Not a Definition
8
+
9
+ The single most important principle. Never open with "Definition: A vector space is..." Instead, open with a question that makes the viewer WANT the definition.
10
+
11
+ ### Examples from Actual Videos
12
+
13
+ | Video | Bad Opening (avoided) | Actual Opening |
14
+ |-------|----------------------|----------------|
15
+ | EoLA Ch 1 | "A vector is an element of a vector space..." | "What are vectors? A physics student, a CS student, and a mathematician would give three different answers..." |
16
+ | EoC Ch 2 | "The derivative is defined as the limit..." | "What does it mean for something to change instantaneously?" |
17
+ | Neural Networks | "A neural network is a computational graph..." | "What IS a neural network?" (then immediately shows MNIST recognition) |
18
+ | Transformers | "A transformer is an attention-based architecture..." | Shows GPT generating text, then asks "How does it actually do this?" |
19
+ | Laplace Transform | "The Laplace transform is defined as..." | Shows how annoying ODEs are to solve, then previews the elegant shortcut |
20
+ | Bayes Theorem | "Bayes' theorem states P(A|B) = ..." | "Most people get this wrong. Here's a medical test question..." |
21
+
22
+ ### How to Find the Right Question
23
+
24
+ 1. Ask "What would a curious student wonder BEFORE knowing this concept?"
25
+ 2. Find the gap between intuition and formalism
26
+ 3. Look for where the obvious approach fails
27
+ 4. Search for "Why does X work?" rather than "What is X?"
28
+
29
+ ---
30
+
31
+ ## Principle 2: Show the WRONG Approach First
32
+
33
+ The "wrong then right" pattern creates contrast that makes the correct approach feel motivated and earned. This is Grant's version of the Socratic method.
34
+
35
+ ### The Moser's Circle Problem Pattern
36
+
37
+ From `_2023/moser_reboot/main.py`:
38
+
39
+ 1. Points on a circle create regions when connected
40
+ 2. Count: 1, 2, 4, 8, 16... "Oh, it must be 2^n!"
41
+ 3. Wait. With 6 points: 31, not 32.
42
+ 4. "The pattern BREAKS. Why?"
43
+ 5. Now the actual combinatorial formula feels necessary
44
+
45
+ ### The Borwein Integral Pattern
46
+
47
+ From `_2022/borwein/main.py`:
48
+
49
+ 1. integral of sinc(x) = pi
50
+ 2. integral of sinc(x)*sinc(x/3) = pi
51
+ 3. integral of sinc(x)*sinc(x/3)*sinc(x/5) = pi
52
+ 4. ... pattern continues...
53
+ 5. Then suddenly: NOT pi
54
+ 6. "What changed?" -- now the viewer is hooked
55
+
56
+ ### Implementation in Video Planning
57
+
58
+ When planning a video, always ask:
59
+ - What's the naive approach viewers will try?
60
+ - Where does it break down?
61
+ - Can I SHOW the failure before presenting the correct method?
62
+
63
+ The time spent on the wrong approach is NOT wasted -- it's the most important pedagogical investment in the video.
64
+
65
+ ---
66
+
67
+ ## Principle 3: Use PHYSICAL ANALOGY Before Formal Math
68
+
69
+ Ground abstract math in physical reality. The viewer should be able to SEE and FEEL the concept before encountering formulas.
70
+
71
+ ### Analogy Map from 3b1b Videos
72
+
73
+ | Abstract Concept | Physical Analogy Used | Video |
74
+ |-------------------|----------------------|-------|
75
+ | Inverse square law | Lighthouses on a lake | Basel Problem (2018) |
76
+ | Differential equations | Pendulum swinging | DiffEq Part 1 (2019) |
77
+ | Fourier series | Rotating arrows (epicycles) | DiffEq Part 4 (2019) |
78
+ | Matrix as transformation | Grid being deformed | EoLA (2016) |
79
+ | Determinant | Area of parallelogram being scaled | EoLA Ch 6 (2016) |
80
+ | Eigenvectors | Vectors that stay on their span during transformation | EoLA Ch 11 (2016) |
81
+ | Normal distribution | Galton board / dice sums | CLT (2023) |
82
+ | Convolution | Sliding dice distributions | Convolutions (2022) |
83
+ | Wave interference | Light waves passing through glass | Optics (2023) |
84
+ | Gradient descent | Ball rolling downhill | Neural Networks Part 2 (2017) |
85
+ | Attention mechanism | Words "looking at" other words via arcs | Transformers (2024) |
86
+ | Laplace transform | Spring-mass system | Laplace (2025) |
87
+ | Hairy ball theorem | Combing hair on a sphere, airplane wind patterns | Hairy Ball (2026) |
88
+ | Stereographic projection | Flattening a sphere to a plane | Hairy Ball (2026) |
89
+
90
+ ### The Analogy-to-Formal Pipeline
91
+
92
+ ```
93
+ 1. Physical scenario (60s): Show the physical system
94
+ 2. Observe patterns (30s): What regularities do we see?
95
+ 3. Quantify (30s): Introduce variables, axes, coordinates
96
+ 4. Write the equation (30s): The formula EMERGES from observation
97
+ 5. Verify (30s): Show the formula predicts the physical behavior
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Principle 4: Build Intuition Through SPECIFIC CASES Before General Formula
103
+
104
+ Never jump to the general case. Always start with n=2, then n=3, then "see the pattern."
105
+
106
+ ### Examples
107
+
108
+ **Derivatives** (EoC Ch 3):
109
+ 1. Derivative of x^2: draw a square, grow it by dx, area change = 2x*dx
110
+ 2. Derivative of x^3: draw a cube, grow it by dx, volume change = 3x^2*dx
111
+ 3. Now the pattern: derivative of x^n = n*x^(n-1)
112
+
113
+ **Determinant** (EoLA Ch 6):
114
+ 1. 2D: area of parallelogram
115
+ 2. 3D: volume of parallelepiped
116
+ 3. General: n-dimensional volume scaling
117
+
118
+ **CLT** (`_2023/clt/main.py`):
119
+ 1. Roll 1 die: uniform
120
+ 2. Sum 2 dice: triangle
121
+ 3. Sum 5 dice: starting to look bell-shaped
122
+ 4. Sum 50 dice: Gaussian!
123
+
124
+ **Convolutions** (`_2022/convolutions/discrete.py`):
125
+ 1. Start with dice example (discrete, small)
126
+ 2. Move to image blur (discrete, visual)
127
+ 3. Then continuous convolution (abstract)
128
+
129
+ ### The Speed Ramp
130
+
131
+ First examples get full animation treatment. Later examples can be sped through because the viewer now has the pattern:
132
+
133
+ ```python
134
+ # From CLT dice simulation
135
+ for n in range(n_sums):
136
+ if n < 10:
137
+ self.run_one_sum(animated=True)
138
+ else:
139
+ self.run_one_sum(animated=False, still_frame=True)
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Principle 5: Show MULTIPLE PERSPECTIVES
145
+
146
+ The same concept viewed from different angles creates deeper understanding. This is the "Two Perspectives -> Unity" narrative pattern.
147
+
148
+ ### Examples from the Codebase
149
+
150
+ **Vectors** (EoLA Ch 1):
151
+ - Physics student: arrows in space
152
+ - CS student: lists of numbers
153
+ - Mathematician: abstract elements of a vector space
154
+
155
+ **Dot Product** (EoLA Ch 9):
156
+ - Geometric: projection of one vector onto another
157
+ - Algebraic: component-wise multiplication and sum
158
+ - Duality: linear transformation from vectors to numbers
159
+
160
+ **Fourier Transform** (`_2018/fourier.py`, `_2022/borwein/`):
161
+ - Time domain: wave amplitude over time
162
+ - Frequency domain: amplitude at each frequency
163
+ - "Fourier Land" side-by-side view
164
+
165
+ **Change of Basis** (EoLA Ch 10):
166
+ - "Your coordinate system"
167
+ - "Jennifer's coordinate system"
168
+ - Both describe the same vectors, different languages
169
+
170
+ ### Implementation
171
+
172
+ The side-by-side comparison scene archetype is key here. Split the screen, show both views, then connect them with arrows, transforms, or color matching.
173
+
174
+ ---
175
+
176
+ ## Principle 6: The "Aha Moment" Placement
177
+
178
+ The central insight should land at 60-70% through the video. This creates proper emotional build-up and leaves time for implications.
179
+
180
+ ### Structure Around the Aha Moment
181
+
182
+ ```
183
+ 0-15%: Hook and setup
184
+ 15-30%: Build tools and vocabulary
185
+ 30-60%: Investigation, examples, building tension
186
+ 60-70%: THE INSIGHT (FlashAround, long wait, dramatic pacing)
187
+ 70-85%: "Now look what happens" -- applications of the insight
188
+ 85-100%: Broader connections, what's next, end screen
189
+ ```
190
+
191
+ ### Cinematic Techniques for the Aha Moment
192
+
193
+ From the codebase, Grant uses these at the key insight:
194
+
195
+ 1. **`FlashAround(result)`**: Visual flash drawing attention
196
+ 2. **`Circumscribe(equation, color=YELLOW)`**: Circle around the key equation
197
+ 3. **`self.wait(2-3)`**: Extended pause -- the longest wait in the video
198
+ 4. **Camera zoom**: `frame.animate.set_height(smaller)` to focus on the result
199
+ 5. **Color burst**: Key element changes to a bright, distinct color
200
+ 6. **Sound (rare)**: `self.add_sound("clack")` or musical sting
201
+
202
+ ### Real Example Flow
203
+
204
+ **Basel Problem lighthouses**:
205
+ ```
206
+ ...builds up the lighthouse geometry for 15 minutes...
207
+ "And if we take the limit as the circle radius goes to infinity..."
208
+ [The flat lighthouse sum equals the curved lighthouse sum]
209
+ [FlashAround the equation]
210
+ [self.wait(3)]
211
+ "...we get pi squared over six."
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Principle 7: Close with Broader Connections
217
+
218
+ Never end with just "and that's the formula." End with WHERE this leads, WHY it matters, or HOW it connects to something unexpected.
219
+
220
+ ### Closing Patterns
221
+
222
+ **"Where does this lead?"**
223
+ - EoLA chapters end with preview of next chapter's concept
224
+ - "In the next video, we'll see how this connects to..."
225
+
226
+ **"This shows up everywhere"**
227
+ - Fourier series: "This same idea appears in quantum mechanics, signal processing, music..."
228
+ - Linear algebra: "Every time you see a matrix, think of this transformation"
229
+
230
+ **"The deeper principle"**
231
+ - Moser's Circle Problem: The general lesson about mathematical induction and pattern-matching
232
+ - CLT: Why the normal distribution is "normal" -- it's the ONLY distribution this could converge to
233
+
234
+ **"Isn't that beautiful?"**
235
+ - Basel Problem: The unlikely connection between prime numbers and pi
236
+ - Euler's Identity: "The most beautiful equation in mathematics"
237
+
238
+ ---
239
+
240
+ ## Principle 8: Calibrate Formality to Audience Need
241
+
242
+ 3b1b videos deliberately use informal language for maximum accessibility, reserving formal notation for when it earns its place.
243
+
244
+ ### The Formality Gradient
245
+
246
+ ```
247
+ Level 0 (most accessible): Physical analogy, no math notation
248
+ Level 1: Named concepts with visual representations
249
+ Level 2: Simple equations with color-coded variables
250
+ Level 3: Multi-step derivations with TransformMatchingTex
251
+ Level 4: Formal proofs with epsilon-delta or axioms
252
+ ```
253
+
254
+ Most 3b1b videos stay at levels 1-3. Level 0 is used for openings and physical setups. Level 4 is rare and always preceded by extensive level 1-2 groundwork.
255
+
256
+ ### Language Choices
257
+
258
+ | Formal | 3b1b Style |
259
+ |--------|-----------|
260
+ | "infinitesimal quantity" | "tiny nudge dx" |
261
+ | "the limit as n approaches infinity" | "as we take more and more terms" |
262
+ | "the transformation T maps V to W" | "this transformation takes vectors and lands them in a new space" |
263
+ | "the derivative is defined as..." | "the derivative tells you how sensitive the function is to small changes" |
264
+ | "by the fundamental theorem of calculus" | "and this is the deep connection between derivatives and integrals" |
265
+
266
+ ---
267
+
268
+ ## Principle 9: Use Recurring Motifs
269
+
270
+ Visual and conceptual callbacks create a sense of coherence across a video and across a series.
271
+
272
+ ### Within a Single Video
273
+
274
+ - The same color always means the same thing (blue=input, green=output, yellow=highlight)
275
+ - A geometric object introduced early returns transformed later
276
+ - The opening question is explicitly answered at the end
277
+
278
+ ### Within a Series
279
+
280
+ - The NumberPlane grid appears in every EoLA chapter
281
+ - The Car mobject recurs throughout EoC
282
+ - Pi creature modes establish emotional continuity
283
+ - Color conventions carry across videos (s_domain=YELLOW, t_domain=BLUE in Laplace)
284
+
285
+ ### The "Callback" Technique
286
+
287
+ ```python
288
+ # Early in the video:
289
+ first_equation = Tex(R"f(x) = x^2")
290
+ self.play(Write(first_equation))
291
+ self.wait()
292
+ self.play(FadeOut(first_equation))
293
+
294
+ # ... 15 minutes later ...
295
+ # Bring it back, transformed:
296
+ callback = Tex(R"f(x) = x^2 + \epsilon g(x)") # Same but evolved
297
+ self.play(FadeIn(callback))
298
+ # "Remember when we started with this simple case?"
299
+ ```
300
+
301
+ ---
302
+
303
+ ## Narrative Structure Templates
304
+
305
+ ### Template A: The Mystery (Best for standalone videos)
306
+
307
+ ```
308
+ 1. Surprising result (hook)
309
+ 2. "Let me show you why this is true"
310
+ 3. Build the framework
311
+ 4. Step-by-step reasoning
312
+ 5. "And that's why [result] must be true"
313
+ 6. "This connects to..."
314
+ ```
315
+
316
+ ### Template B: The Builder (Best for concept introduction)
317
+
318
+ ```
319
+ 1. "What is [concept]?"
320
+ 2. Simple version first
321
+ 3. Add complexity gradually
322
+ 4. "Now here's the full picture"
323
+ 5. "Notice how [elegant property]"
324
+ 6. "In the next video, we'll use this to..."
325
+ ```
326
+
327
+ ### Template C: The Debate (Best for "Two perspectives" topics)
328
+
329
+ ```
330
+ 1. Perspective A (geometric)
331
+ 2. Perspective B (algebraic)
332
+ 3. "These seem different, but..."
333
+ 4. Show the connection
334
+ 5. "Understanding both gives you..."
335
+ 6. Application that requires both
336
+ ```
337
+
338
+ ### Template D: The Journey (Best for historical topics)
339
+
340
+ ```
341
+ 1. "Imagine you're [historical figure]..."
342
+ 2. The problem they faced
343
+ 3. Their first attempt
344
+ 4. The breakthrough insight
345
+ 5. Modern understanding
346
+ 6. "And this opened the door to..."
347
+ ```
348
+
349
+ ---
350
+
351
+ ## Common Storytelling Mistakes to Avoid
352
+
353
+ 1. **Skipping the "why should I care?"** -- Every concept needs motivation before presentation.
354
+ 2. **Definition before intuition** -- Build visual understanding first, then name it.
355
+ 3. **Too many concepts at once** -- One major concept per scene. Two max per video section.
356
+ 4. **No emotional variation** -- Alternate between tension (confusion) and release (clarity).
357
+ 5. **Ending with a formula** -- End with meaning, connection, or beauty. The formula is a stepping stone.
358
+ 6. **Assuming the viewer sees what you see** -- Explicitly point out patterns. Use Indicate(), color changes, annotations.
359
+ 7. **Equal time for unequal importance** -- Spend 3 minutes on the key insight, 30 seconds on the trivial step. Don't allocate time evenly.
@@ -0,0 +1,221 @@
1
+ # Narrative Patterns for Math Explainers
2
+
3
+ Common structures used in effective 3Blue1Brown-style videos, derived from analysis of 400+ video source files (2015-2026).
4
+
5
+ ---
6
+
7
+ ## Pattern 1: Mystery --> Investigation --> Resolution
8
+
9
+ **Structure:**
10
+ 1. Present a puzzling result or paradox
11
+ 2. Investigate why it's true through visual exploration
12
+ 3. Reveal the underlying principle
13
+ 4. Show how the principle generalizes
14
+
15
+ **Example topics:** Euler's identity, Bayes theorem, infinite series paradoxes, Borwein integrals, colliding blocks and pi
16
+
17
+ **Opening hooks:**
18
+ - "What does it even mean to raise a number to an imaginary power?"
19
+ - "This equation looks wrong, but it's actually true..."
20
+ - "Most people get this probability question wrong..."
21
+ - "Count the collisions. Why is pi showing up?"
22
+
23
+ **Actual videos using this pattern:**
24
+ - **Colliding Blocks** (`_2019/clacks/`): Pi appears in collision count. The mystery IS the hook.
25
+ - **Basel Problem** (`_2018/basel/`): Why does 1 + 1/4 + 1/9 + ... = pi^2/6? Lighthouses provide the investigation.
26
+ - **Borwein Integrals** (`_2022/borwein/`): Integrals equal pi until they don't. Moving averages provide the explanation.
27
+
28
+ ---
29
+
30
+ ## Pattern 2: Build Up --> Payoff
31
+
32
+ **Structure:**
33
+ 1. Introduce simple building blocks
34
+ 2. Combine them to create something complex
35
+ 3. Show the beautiful/surprising result
36
+ 4. Reflect on why it works
37
+
38
+ **Example topics:** Fourier series, neural networks, linear algebra, transformer architecture
39
+
40
+ **Opening hooks:**
41
+ - "Let's start with something simple..."
42
+ - "Each piece here is easy, but together they do something remarkable..."
43
+
44
+ **Actual videos using this pattern:**
45
+ - **Fourier Series** (`_2019/diffyq/part4/`): Individual rotating arrows combine to trace any shape.
46
+ - **Neural Networks** (`_2017/nn/`): Neurons -> layers -> network -> recognition.
47
+ - **CLT / Gaussian Build-Up** (`_2023/clt/`): `BuildUpGaussian` constructs the Gaussian formula term by term.
48
+ - **Transformer Architecture** (`_2024/transformers/network_flow.py`): Embedding -> attention -> MLP -> unembedding, one block at a time.
49
+
50
+ ---
51
+
52
+ ## Pattern 3: Two Perspectives --> Unity
53
+
54
+ **Structure:**
55
+ 1. Show concept from perspective A (e.g., algebraic)
56
+ 2. Show same concept from perspective B (e.g., geometric)
57
+ 3. Reveal they're the same thing
58
+ 4. Explore implications of this connection
59
+
60
+ **Example topics:** Dot product, determinants, complex multiplication, Fourier transform
61
+
62
+ **Opening hooks:**
63
+ - "There are two ways to think about this..."
64
+ - "These seem like completely different ideas, but..."
65
+
66
+ **Actual videos using this pattern:**
67
+ - **EoLA Ch 9 - Dot Products and Duality** (`_2016/eola/chapter9.py`): Geometric projection vs. algebraic computation. Same result, deeply connected through duality.
68
+ - **EoLA Ch 1 - Vectors** (`_2016/eola/chapter1.py`): Physics student (arrows), CS student (lists), mathematician (abstract). Three perspectives on one concept.
69
+ - **Borwein/Convolutions Split Screen** (`_2022/borwein/supplements.py`): Time domain on left, "Fourier Land" on right with teal shading.
70
+ - **Change of Basis** (`_2016/eola/chapter10.py`): "Your coordinates vs Jennifer's coordinates" -- same vectors, different languages.
71
+
72
+ ---
73
+
74
+ ## Pattern 4: Wrong --> Less Wrong --> Right
75
+
76
+ **Structure:**
77
+ 1. Present common misconception or naive approach
78
+ 2. Show why it fails
79
+ 3. Refine the approach
80
+ 4. Arrive at correct understanding
81
+
82
+ **Example topics:** Limits, probability distributions, definitions, Moser's circle problem
83
+
84
+ **Opening hooks:**
85
+ - "Your first instinct here is probably wrong..."
86
+ - "The obvious approach doesn't quite work..."
87
+
88
+ **Actual videos using this pattern:**
89
+ - **Moser's Circle Problem** (`_2023/moser_reboot/`): 1, 2, 4, 8, 16... 32? No, 31. The "obvious" pattern of 2^n is WRONG.
90
+ - **Bayes Theorem** (`_2019/bayes/`, `_2020/med_test.py`): Naive probability intuition fails. The population grid approach corrects it.
91
+ - **EoC Ch 7 - Limits** (`_2017/eoc/chapter7.py`): Informal "approaches" notion refined to epsilon-delta.
92
+ - **Wordle Analysis** (`_2022/wordle/footnote.py`): Original analysis had a bug! `HeresTheThing(TeacherStudentsScene)` acknowledges the error.
93
+
94
+ ---
95
+
96
+ ## Pattern 5: Specific --> General
97
+
98
+ **Structure:**
99
+ 1. Solve a specific concrete example
100
+ 2. Notice patterns in the solution
101
+ 3. Abstract to general principle
102
+ 4. Apply to new situations
103
+
104
+ **Example topics:** Derivatives, group theory, algorithm analysis, CLT
105
+
106
+ **Opening hooks:**
107
+ - "Let's work through a specific example..."
108
+ - "Once you see the pattern here, it shows up everywhere..."
109
+
110
+ **Actual videos using this pattern:**
111
+ - **EoC Ch 3 - Derivative Formulas** (`_2017/eoc/chapter3.py`): d/dx(x^2) via square area, d/dx(x^3) via cube volume, then the general power rule.
112
+ - **CLT Dice Sums** (`_2023/clt/main.py`): 1 die -> 2 dice -> 5 dice -> 50 dice -> "always Gaussian!"
113
+ - **Convolutions** (`_2022/convolutions/discrete.py`): Dice example (discrete, small) -> image blur (discrete, visual) -> continuous convolution (abstract).
114
+
115
+ ---
116
+
117
+ ## Pattern 6: History as Narrative
118
+
119
+ **Structure:**
120
+ 1. Present the problem as historically encountered
121
+ 2. Follow the journey of discovery
122
+ 3. Show key insights that led to breakthroughs
123
+ 4. Connect to modern understanding
124
+
125
+ **Example topics:** Calculus, cryptography, quantum mechanics, Galois theory
126
+
127
+ **Opening hooks:**
128
+ - "Imagine you're a mathematician in the 1600s..."
129
+ - "This problem stumped the greatest minds for centuries..."
130
+
131
+ **Actual videos using this pattern:**
132
+ - **Galois Theory** (`_2022/galois/`): Galois's night before his fatal duel, scribbling mathematics. Uses `OutpaintTransition` for artwork panning with custom bezier rate functions, `LastWordsQuote` for historical text.
133
+ - **Feynman's Lost Lecture** (`_2018/lost_lecture.py`): Recreating Feynman's geometric proof of elliptical orbits.
134
+ - **Cosmic Distance / Venus Transit** (`_2025/cosmic_distance/part2.py`): Historical timeline with GlowDots showing key astronomical measurements.
135
+
136
+ ---
137
+
138
+ ## Pattern 7: Tourist's Guide
139
+
140
+ **Structure:**
141
+ 1. Explicitly frame as a survey, not a deep dive
142
+ 2. Show several related concepts at a birds-eye level
143
+ 3. Highlight connections between them
144
+ 4. Point the viewer toward deeper resources
145
+
146
+ **Actual videos using this pattern:**
147
+ - **DiffEq Part 1** (`_2019/diffyq/part1/`): "A tourist's guide to differential equations" -- pendulums, phase space, vector fields, population models, all in one video.
148
+ - **Group Theory / Monster** (`_2020/monster.py`): Survey of symmetry groups leading to the Monster group's staggering size.
149
+
150
+ ---
151
+
152
+ ## Pattern 8: Puzzle / Challenge
153
+
154
+ **Structure:**
155
+ 1. State a simple-sounding puzzle
156
+ 2. Let the viewer try (implicit or explicit pause)
157
+ 3. Show the elegant solution
158
+ 4. Connect to deeper mathematics
159
+
160
+ **Actual videos using this pattern:**
161
+ - **Windmill Problem** (`_2019/windmill.py`): IMO problem with visual solution.
162
+ - **Chess Puzzle** (`_2020/chess.py`): XOR-based encoding with custom `FlipCoin` animation.
163
+ - **Putnam Problems** (`_2017/putnam.py`): Competition problems with elegant visual proofs.
164
+ - **Determinant Puzzle** (`_2018/determinant_puzzle.py`): Geometric puzzle using determinant properties.
165
+
166
+ ---
167
+
168
+ ## Combining Patterns
169
+
170
+ Most effective videos combine multiple patterns:
171
+ - **Mystery hook + Build Up explanation**: Colliding blocks (mystery: why pi?) + progressive understanding
172
+ - **Two Perspectives + Specific -> General**: Dot product (geometric + algebraic) + works for any dimension
173
+ - **Wrong -> Right + Puzzle**: Moser's circle (wrong pattern + counting puzzle)
174
+ - **History + Mystery**: Basel problem (Euler's quest + why pi?)
175
+ - **Tourist's Guide + Physical Scenario**: DiffEq (survey format + pendulum simulation)
176
+
177
+ ---
178
+
179
+ ## Pacing Guidelines
180
+
181
+ | Video Length | Intro Hook | Main Content | Recap/Implications |
182
+ |--------------|------------|--------------|-------------------|
183
+ | 5-10 min | 30-60s | 4-8 min | 30-60s |
184
+ | 15-20 min | 1-2 min | 12-16 min | 1-2 min |
185
+ | 30+ min | 2-3 min | 24-26 min | 2-4 min |
186
+
187
+ ---
188
+
189
+ ## Emotional Arc
190
+
191
+ Every video should have emotional beats:
192
+
193
+ 1. **Curiosity** (opening) - Why should I care? (Question, mystery, surprise)
194
+ 2. **Confusion** (early) - This is harder than it looks (Wrong approach, complexity)
195
+ 3. **Partial clarity** (middle) - I'm starting to see... (First examples, building blocks)
196
+ 4. **Aha moment** (climax, 60-70% through) - Oh! That's beautiful! (FlashAround, long wait)
197
+ 5. **Satisfaction** (end) - Now I truly understand (Recap, broader connections)
198
+
199
+ ### Pi Creature Emotional Modes as Audience Surrogates
200
+
201
+ From the codebase, Pi creatures express the viewer's emotions:
202
+ - **Confusion**: `"confused"`, `"erm"`, `"horrified"` -- "I don't get it yet"
203
+ - **Curiosity**: `"pondering"`, `"thinking"` -- "Hmm, interesting..."
204
+ - **Understanding**: `"happy"`, `"hooray"` -- "I see it now!"
205
+ - **Surprise**: `"surprised"` -- "Wait, WHAT?"
206
+ - **Skepticism**: `"sassy"`, `"angry"` -- "That can't be right..."
207
+
208
+ These modes map to the emotional arc: confusion early, curiosity in the middle, understanding and surprise at the climax.
209
+
210
+ ---
211
+
212
+ ## The "Earned Insight" Principle
213
+
214
+ The viewer must WORK for the aha moment. If you give away the insight too early, it doesn't feel earned. The emotional payoff is proportional to the intellectual investment.
215
+
216
+ **Structure for earning an insight:**
217
+ 1. Show why the naive approach fails (investment)
218
+ 2. Build the correct framework piece by piece (investment)
219
+ 3. Let the pieces come together (payoff)
220
+ 4. Pause. Let it breathe. `self.wait(3)` (savor)
221
+ 5. Show what this enables (bonus payoff)