19 comments

[ 2.6 ms ] story [ 54.9 ms ] thread
If you haven't heard of 3 Blue 1 Brown, congrats[0] because you are in for a treat. He is simply one of the best intuitive math video creators in the game right now. I can't even a good intro, just find something interesting or something you're confused about and enjoy[1]

[0]: https://xkcd.com/1053/ [1]: https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw

BTW, he's currently co-teaching a course on Julia with some really great lectures on computational thinking:

https://computationalthinking.mit.edu/Fall20/

He also had a nice video about epidemics/pandemics: https://www.youtube.com/watch?v=gxAaO2rsdIs

All using manim for visualizations.

I just started watching the intro to linear algebra course this morning, so this is quite the coincidence! I'm really appreciating how visual the explanations are, I find it much easier to reason about these things geometrically.
If you like this, also check out the Haskell reanimate[1] library. It's a library for animated diagrams inspired by Manim but with a different API design and feature set.

Here's a snippet to trace out a rotating rectangle:

    do s <- fork $ newSpriteA drawBox
       v <- spriteVar s 0 rotate
       tweenVar v 2 $ \val -> fromToS val 90
The API docs[2] have a bunch of small examples like this illustrated with inline gifs, which I think is a great touch.

[1]: https://github.com/reanimate/reanimate

[2]: https://hackage.haskell.org/package/reanimate-1.1.2.1/docs/R...

Thank you for the library tip!
It’s too bad the gifs seem to be just file references instead of real-time animations. Looks like some of the code snippets do not match their animations.

For example, parLoopA and parDropA seem to have the same sample code, but have different animations.

Good catch. Fixed in HEAD.
Great timing! I've been looking for something like this to generate code walkthroughs (among other things).

After a bit of playing around, here is a simple video (with linked source) of using Manim (the community edition) to generate a quick walkthrough:

https://www.youtube.com/watch?v=i-pvpQsZD_I

Most of this could also be created via an editor like DaVinci Resolve, but the programmer in me likes the consistency and flexibility of a code-driven video.

Nice! Is there a steep learning curve with Manim? How long did it take to create that video?
Sadly, it took me a few hours, but only because I went down a rabbit hole of trying to render a colorized code snippet without knowing the Code class existed. I got to the point of a custom Tex template that used listings, only to find out Manim strips any color, so I attempted to parse the SVG and reinsert color using Manim APIs... only to find out Code did everything I wanted and more :)

Once I found out about Code, I'd say probably 15 minutes to land on the opacity strategy and a few minutes to learn how to control the camera, so in the end, not bad. The limiting factor is now figuring out what I want it to do in the first place.

Cool demo. I tried using manim a while ago but struggled setting it up and creating anything worthwhile. This looks like a solid and simple starting point to expand from, thanks!