laitimes

Make high-pressure mathematical animations in Python

Usually, you may always see a variety of cool mathematical animations, but do not know what to make, this time to recommend an artifact that can make mathematical animation: manim.

Manim is an open source mathematical simulation python library by Grant Sanderson, a brother in stanford's department of mathematics, and is used on YouTube channel 3Blue1Brown to explain advanced mathematics.

Private message Xiaobian 01 can get a large number of Python learning resources

Manim is a very good mathematical animation engine, let's start with two GIFs to feel the charm of manim:

Make high-pressure mathematical animations in Python
Make high-pressure mathematical animations in Python

Many students should have seen the 3b1b video on the B station, and the most classic is the essential series of linear algebra.

Make high-pressure mathematical animations in Python

Imprint

Manim beginners may be a little confused, the code, documentation, tutorials, etc. on the Internet are too different to know which one to follow.

There are currently three versions of manim:

Make high-pressure mathematical animations in Python

By: Crane Xiang Wanli & widcardw

3b1b Legacy: 3blue1brown maintains its own version, using Cairo as the backend.

New version of 3b1b: 3blue1brown's own version, using OpenGL and moderngl for GPU rendering, the advantage is fast.

Manim Community Edition: A derivative of the older version of manim, the update is more active, with good documentation and community support.

I learned the new version directly.

Manimgl environment build

This version of manimgl is particularly easy to install

1. Install and configure FFmpeg and LaTex

https://ffmpeg.org/download.html

FFmpeg, download and install, add the installation path to the environment variable

https://mirror.ctan.org/systems/texlive/tlnet/install-tl-windows.exe LaTex

Simpler, just take the next step.

2. Create a virtual environment

conda create -n manim python=3.8
conda activate manim           

3. Install the manimgl package

pip install manimgl           

It can also be installed from the clone latest source code

git clone https://github.com/3b1b/manim.git
cd manim
pip install -e .           

This also allows you to test whether the installation was successful.

manimgl example_scenes.py OpeningManimExample           

Learning resources

Official Documentation:

https://3b1b.github.io/manim

Chinese Documentation:

https://docs.manim.org.cn/

3b1b Video Source Code:

https://github.com/3b1b/videos

manim source code:

https://github.com/3b1b/manim

You can read the Chinese/English documents first, and then start making your own animations. If you have time, you can look at the 3b1b video (combined with the source code), if you have spare time, it is better if you can contribute code to manim.

Make high-pressure mathematical animations in Python

Recently on YouTube saw a video of making data structures and algorithms with manim, which is quite strong.

Make high-pressure mathematical animations in Python

Video Source Code:

https://github.com/nipunramk/Reducible