Slides, code and documentation are available in open source. See last slide.
To quote 3Blue1Brown:
Manim is an engine for precise programmatic animations, designed for creating explanatory math videos.
Our definition:
Manim is a Python tool that facilitates creating math-related videos.
"I don't know anything about Python"
"I don't like programming"
"I usually run into troubles when installing Python modules"
# scenes.py
from manim import *
class SquareToCircle(Scene):
def construct(self):
circle = Circle(color=RED)
square = Square()
self.play(Create(square))
self.play(Transform(square, circle))
self.play(FadeOut(square))
manim scenes.py SquareToCircle
In a few lines of code, Manim can create nice and precise animations, facilitating scientific communication.
How to explain the Newton-Raphson's iterative method, used to find a root some function $f$?
$$ x_{k+1} = x_{k} - \frac{f(x_k)}{f'(x_k)} $$Goals:
Reasons to prefer Manim:
Reasons to prefer ManimGL:
See GitHub README.
Follow the guide, e.g., for Manim: |
# myfile.py
from mamim import *
class MyScene(Scene):
def construct(self):
square = Square()
self.play(Create(square))
self.play(square.animate.rotate(90 * DEGREES))
self.play(square.animate.set_color(BLUE))
self.play(Circumscribe(square, Circle))
self.play(Uncreate(square))
From the ManimCommunity/manim repository:
Additionally, Manim can render images (e.g., see first slide) or gif.
Create more advanced animation, and get inspiration from others, see:
"Is Manim for everyone?"
"Is Manim for every presentation?"
"What should I be aware of?"
"When is Manim particularly useful?"
Many plugins were created by users, some of which can be found on https://plugins.manim.community/.
We particularly like:
This presentation uses Manim inside Jupyter Notebook cells.
%%manim SquareToCircle
class SquareToCircle(Scene):
def construct(self):
circle = Circle(color=RED)
square = Square()
self.play(Create(square))
self.play(Transform(square, circle))
self.play(FadeOut(square))
The Manim Community wrote a comprehensive tutorial on how to use Manim inside a Jupyter Notebook!
NOTE: this feature is only available with Manim, not ManimGL
Remember root finding example from earlier?
What if we could pause the video whenever we want? Go backward, forward, reverse, and so on?
With Manim Slides, you can transform any Manim / ManimGL scene into a PowerPoint-like presentation!
from manim import *
from manim_slides import Slide
class RootExample(Scene): RootExample(Slide):
def construct(self):
# Not shown: constructing axes, labels, graph, dots, etc.
self.add(ax, labels, graph, dot) # Add plot to scene
self.wait() # Wait for some time
self.pause()
self.play(Create(tangent)) # Animate tanget creation
self.pause()
self.play(Write(fraction)) # Animate fraction writing
self.pause()
while abs(f(x)) > 1e-6: # Until convergence
dx = -f(x) / df(x)
x += dx
# Not shown: new dest., and creating horiz. arrow
self.play(Create(direction)) # Animate arrow creation
self.play(...) # Animate dot's displacement and arrow's fading
self.pause()
self.wait(5) # Wait for some time