Brownian Motion: From Pollen to Portfolio

A journey from Robert Brown's microscope to Einstein's heat equation, arriving at the Black-Scholes model for financial options pricing.
Recursive Rhombicosidodecahedron

A fractal Archimedean solid where every vertex spawns another complete rhombicosidodecahedron.
The Hopf Fibration

Stereographic projection of S3 fibers creating nested tori - pure topology rendered in 3D.
The Whiskering Exchange

Visualizing the commutative property of 2-cell composition in higher category theory.
Math-To-Manim offers three distinct AI pipelines. Choose based on your API access and preferences:
| Feature | Gemini 3 (Google ADK) | Claude Sonnet 4.5 | Kimi K2 |
|---|---|---|---|
| Framework | Google Agent Development Kit | Anthropic Agent SDK | OpenAI-compatible API |
| Architecture | Six-Agent Swarm | Six-Agent Pipeline | Three-Stage Enrichment |
| Strengths | Complex topology, physics reasoning | Reliable code generation, recursion | Chain-of-thought, structured tools |
| Best For | Advanced 3D math, Kerr metrics | General purpose, production use | LaTeX-heavy explanations |
| Setup Complexity | Moderate | Simple | Simple |
Location: Gemini3/
The Gemini pipeline uses the Google Agent Development Kit with a six-agent swarm architecture. Each agent is a specialist with a specific role in the animation generation process.
# Set API key
echo "GOOGLE_API_KEY=your_key_here" >> .env
# Run the pipeline
python Gemini3/run_pipeline.py "Explain the Hopf Fibration"
Gemini3/run_pipeline.py - Entry pointGemini3/src/agents.py - Agent definitions with system promptsGemini3/src/pipeline.py - Orchestration logicGemini3/docs/GOOGLE_ADK_AGENTS.md - Full documentationLocation: src/
The Claude pipeline uses the Anthropic Agent SDK with automatic context management and built-in tools.
src/app_claude.py - Gradio UI entry pointsrc/agents/prerequisite_explorer_claude.py - Claude SDK agentdocs/ARCHITECTURE.md - System design detailsLocation: KimiK2Thinking/
The Kimi pipeline uses Moonshot AI's K2 thinking model with an OpenAI-compatible API and tool-calling interface.
# Set API key
echo "MOONSHOT_API_KEY=your_key_here" >> .env
# Run prerequisite exploration
python KimiK2Thinking/examples/test_kimi_integration.py
# Run full enrichment pipeline
python KimiK2Thinking/examples/run_enrichment_pipeline.py path/to/tree.json
KimiK2Thinking/kimi_client.py - API clientKimiK2Thinking/agents/enrichment_chain.py - Three-stage pipelineKimiK2Thinking/README.md - Complete documentation# Clone repository
git clone https://github.com/HarleyCoops/Math-To-Manim
cd Math-To-Manim
# Install dependencies
pip install -r requirements.txt
# Set up your preferred API key
echo "ANTHROPIC_API_KEY=your_key" >> .env # For Claude
echo "GOOGLE_API_KEY=your_key" >> .env # For Gemini
echo "MOONSHOT_API_KEY=your_key" >> .env # For Kimi
# Install FFmpeg (required for video rendering)
# Windows: choco install ffmpeg
# Linux: sudo apt-get install ffmpeg
# macOS: brew install ffmpeg
We have 55+ working examples organized by topic:
# Physics - Black Hole Symphony
manim -pql examples/physics/black_hole_symphony.py BlackHoleSymphony
# Mathematics - Hopf Fibration
manim -pql examples/misc/epic_hopf.py HopfFibrationEpic
# Finance - Option Pricing
manim -pql examples/finance/optionskew.py OptionSkewScene
# Computer Science - Neural Networks
manim -pql examples/computer_science/machine_learning/AlexNet.py AlexNetScene
Flags: -p preview, -q quality (l low, m medium, h high, k 4K)
Browse all examples: docs/EXAMPLES.md
Math-To-Manim/
|
+-- src/ # Claude Sonnet 4.5 pipeline
| +-- agents/ # Agent implementations
| +-- app_claude.py # Gradio UI
|
+-- Gemini3/ # Google Gemini 3 pipeline
| +-- src/ # Agent definitions
| +-- docs/ # Gemini-specific docs
| +-- run_pipeline.py # Entry point
|
+-- KimiK2Thinking/ # Kimi K2 pipeline
| +-- agents/ # Enrichment chain
| +-- examples/ # Usage examples
|
+-- examples/ # 55+ working animations
| +-- physics/ # Quantum, gravity, particles
| +-- mathematics/ # Geometry, topology, analysis
| +-- computer_science/ # ML, algorithms
| +-- cosmology/ # Cosmic evolution
| +-- finance/ # Option pricing
|
+-- docs/ # Documentation
+-- tests/ # Test suite
+-- tools/ # Utility scripts
"Create an animation showing quantum field theory"
Result: Generic, incorrect, or broken code.
"Begin with Minkowski spacetime showing the metric:
$$ds^2 = -c^2 dt^2 + dx^2 + dy^2 + dz^2$$
Each component highlighted in different hues. Introduce the QED Lagrangian:
$$\mathcal{L}_{\text{QED}} = \bar{\psi}(i \gamma^\mu D_\mu - m)\psi - \tfrac{1}{4}F_{\mu\nu}F^{\mu\nu}$$
with Dirac spinor $\psi$ in orange, covariant derivative $D_\mu$ in green..."
Result: Perfect animations with correct LaTeX, camera movements, and timing.
Our agents generate these verbose prompts automatically by walking the knowledge tree.
| Problem | Traditional Approach | Our Solution |
|---|---|---|
| LaTeX Errors | Hope for the best | Verbose prompts show exact formulas |
| Vague Cinematography | "Show quantum field" | Specify colors, angles, timing |
| Missing Prerequisites | Jump to advanced topics | Recursive dependency discovery |
| Inconsistent Notation | Mixed symbols | Mathematical enricher maintains consistency |
$ claude mcp add Math-To-Manim \
-- python -m otcore.mcp_server <graph>