Manim Video
Manim is an animation engine (Python) for precise mathematical/explanatory videos. Write a scene, render it to MP4 with manim.
When to use
- "animate / make a video showing …"
- Math derivations, algorithm visualizations, geometric constructions.
- Step-by-step explainers.
Workflow
- Write a Python scene file using the Manim API. Save with the
writetool, e.g.scene.py. - Render:
manim -pql scene.py SceneName(low quality preview,-pplays after). Use-pqhfor high quality / final. - Output MP4 lands under
media/videos/.... State the path.
Minimal scene template
from manim import *
class Squares(Scene):
def construct(self):
s = Square(side_length=2, color=BLUE)
self.play(Create(s))
self.play(s.animate.rotate(PI / 2).set_color(RED))
self.wait()
Tips
- Keep scenes short and focused; one idea per scene.
- Animate one property change per
self.play(...)step so it reads clearly. - For text, use
MathTex(LaTeX math) orText(plain). - Prefer
-qlpreviews while iterating; switch to-qhonly for the final render. - Requires
python3and themanimpackage (install via pip). Per project rules, never use npm-equivalents for JS; here Manim is Python so pip is correct.