Scripts2026年3月29日·1 分钟阅读

Manim — Mathematical Animation Engine

Community-maintained Python library for creating mathematical animations and explanatory videos. Used by 3Blue1Brown. 70,000+ GitHub stars.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

pip install manim
manim -pql scene.py MyScene
from manim import *

class HelloWorld(Scene):
    def construct(self):
        text = Text("Hello, World!")
        self.play(Write(text))
        self.wait()

介绍

Manim is the animation engine behind 3Blue1Brown — the most popular math YouTube channel. It's a Python library for creating precise mathematical animations and explanatory videos programmatically. Define scenes in Python, and Manim renders them as high-quality video. 70,000+ GitHub stars, used by educators and content creators worldwide.

Best for: Math educators, technical explainer videos, data visualization animations Works with: Python 3.8+, LaTeX (optional for math notation) Setup time: 5 minutes


Key Features

  • Mathematical objects: Equations, graphs, number lines, geometric shapes, 3D surfaces
  • Smooth animations: Transform, FadeIn, Write, Create, MoveAlongPath, and dozens more
  • Camera control: Pan, zoom, rotate camera in 2D and 3D scenes
  • LaTeX rendering: Beautiful mathematical notation via LaTeX
  • Programmatic: Everything is Python code — version control, parameterize, automate

Example: Animated Graph

from manim import *

class SineCurve(Scene):
    def construct(self):
        axes = Axes(x_range=[-3, 3], y_range=[-1.5, 1.5])
        graph = axes.plot(lambda x: np.sin(x), color=BLUE)
        label = axes.get_graph_label(graph, label="\\sin(x)")
        self.play(Create(axes), Create(graph), Write(label))
        self.wait()

FAQ

Q: What is Manim? A: Manim is a Python library for creating mathematical animations programmatically, originally developed by 3Blue1Brown. The community edition (ManimCE) has 70,000+ GitHub stars.

Q: Is Manim free? A: Yes. Manim Community Edition is MIT-licensed and completely free.

Q: How do I install Manim? A: Run pip install manim. Optional: install LaTeX for math notation rendering.


🙏

来源与感谢

Created by ManimCommunity. Licensed under MIT. manim — ⭐ 70,000+ Docs: docs.manim.community

相关资产