Best program for creating educational math animations?

I'm looking for recommendations on what program to use for creating mathematical animations. These animations will be used in creating educational videos for high school math -- Trigonometry first, but others will come later. I am particularly focusing on teaching the material from a conceptual basis, and to that end, I want to create high-quality animations that can help students understand the ideas they're working with.

What program would be particularly well suited for making math animations aimed at teaching high school level material? I'm willing to learn a scripting/programming language (or at least enough of one) if that's the best choice. Upfront time investment is okay: I'll likely be making quite a few of these animations over the next few years.

Requirements

  • Plotting (2d): Needs to be able to plot single-variable functions and then animate through manipulation of one or more parameters.
  • Export Animations: It must be possible to export the animation to some form of movie file format or animated GIF.

Not Required, but Nice

  • Graphics Primitives: The program should have various primitives (line segments, circles, etc.) that are also capable of animation. This can be worked around by doing enough plotting, but it's much more elegant to have access to primitives.
  • Runs on Mac: I do most of my work on my Mac laptop, so that's the preferred OS.
  • Free (preferably open-source): Not much budget at the moment. Additionally, I plan to open-source all of the materials I use in creating the videos, so that's less useful if the work is done on a paid program.

Here's my current list of possibilities.

Free Options

  • GeoGebra
  • GIFsmos (Takes Desmos animations as inputs and spits out GIFs)

Paid Options

  • Mathematica
  • MATLAB
  • Maple

Non-Math-Focused Option

  • Adobe Flash (Can't [I think?] handle plotting, but might be best choice for working with simple graphics.)

If you think one of the above candidates is a great choice, please let me know why you think so in your answer. If you think that there's another option better than the above, please tell me about it.

Summary: What is the best program for making math animations, knowing that the intent is to use them in videos teaching high school math?


Solution 1:

There is a youtuber who also works at Khan Academy as far as I am aware. He created his own animation program specifically designed for mathematics animation and I believe anyone is free to use it. I think it looks very good. He goes by the username 3Blue1Brown on youtube.

Solution 2:

One option is also GNU Dr. Geo, a libre interactive geometry and programming software I wrote, you can use it on Mac OS X

Regarding plotting capabilities, it is best used with its programming interface to produce very interesting and appealing interactive diagram. For example, related to single variable function, root finding algorithms can be compared.

First the bisection method:

Bisection method

Resulting from its script:

| sketch f  ptA ptB middle ox|
sketch := DrGeoCanvas new axesOn.
f := [ :x | x cos + (x * 1.1) ].
sketch plot: f from: -20 to: 20.
ox := (sketch line: 0@0 to: 1@0) lock hide.
ptA := sketch pointOnCurve: ox at: 0.1.
ptA moveTo: 5@0; 
    color: Color green;
    large; 
    name: 'Drag me'.
ptB := sketch pointOnCurve: ox at: -0.1.
ptB moveTo: -5@0; 
    color: Color green;
    large; 
    name: 'Drag me too'.
1 to: 10 do: [ :index |
    middle := sketch middleOf: ptA and: ptB.
    ptA := sketch point: [ :pts |
        (f value: pts first point x) sign = (f value: pts second point x) sign
            ifTrue: [ pts second point ] 
            ifFalse: [ pts first point]] parents: { ptA. middle }.
    ptB := sketch point: [ :pts |
        (f value: pts first point x) sign = (f value: pts second point x) sign
            ifTrue: [ pts first point ] 
            ifFalse: [ pts second point]] parents: {middle. ptB }].
sketch update.

Then compare it with the Newton-Raphson method:

Newton Raphson method

From its script:

| sketch f df xn ptA ptB|
sketch := DrGeoCanvas new axesOn.
xn := 2.
f := [ :x | x cos + (x * 1.1) ].
df := [ :x | (f value: x + 1e-8) - (f value: x) * 1e8]. "Derivate number"
sketch plot: f from: -20 to: 20.
ptA := (sketch point: xn@0) large; name: 'Drag me'.
5 timesRepeat: [ 
    ptB := sketch point: [ :pt | pt point x @ (f value: pt point x)] parent: ptA.
    ptB hide.
    (sketch segment: ptA to: ptB) dotted forwardArrow .
    ptA := sketch point: [:pt | 
        | x |
        x := pt point x.
        x - ( (f value: x) / (df value: x) )  @ 0 ] parent: ptB.
    ptA hide.
    (sketch segment: ptB to: ptA) dotted forwardArrow].

The scripts don't compute static diagrams but construction trees, based on euclidean geometry properties. It implies its objects can be moved/animated in the diagram and it results in an updated sketch. Here in the examples, moving the point Drag me and Drag me too will update the depending points computed from the bisection and Newton-Raphson algorithms. This is where it is interesting to produce teaching material to demonstrate.

To record video, I always use external video recorder tools because I find more interesting to animate myself the sketch by dragging objects inside. For example like this demo, not targeted to kids though. If enough interest, I could implement an animated GIF exporter, but I am not sure about the added value.

Solution 3:

There's this open-source tool that's gotten pretty popular recently. It's called Manim - the math animation engine, originally developed by Grant Sanderson (who is the man behind the popular math YouTube channel 3b1b) while he was an undergrad.

His videos feature extremely pleasing animations which served as an ultimate motivation for me to study quantum mechanics. He made his tool open-source and from then the manim engine has gained huge popularity among many math YouTubers. The fact that it's Python-based makes it even more appealing and easy-to-use.

Though the official documentation is a little lagging behind (I feel) there are many forks on GitHub, some of which have better documentation like this one and this one. There are fairly good number of tutorials that teach animation in manim. It's evident that there's a growing community adopting this fairly new tool.

Solution 4:

I won't say it is (or isn't) the best choice, but I will say it's possible, though maybe a bit challenging, with Sage:

enter image description here

This image is from this link.

I can confirm that Sage plays nicely with OS X (better than with Windows, I believe), although I've never tried to animate anything; it may have quite a learning curve. You can download and run everything on your computer, or create an account at their cloud website and do everything online, to see give it a test drive.

Best of all, it's free and open source.

Solution 5:

A very good option for this is python's matplotlib library. Since python is so widespread and has a large ecosystem, it is a good option for most people, and it's free of course.

There are a number of approaches to animation in matplotlib; perhaps the simplest is to just update your plot and output a series of images, which you can compile into an animation externally using ImageMagick.

If you want to be more advanced, you can try matplotlib's animation class, although I personally found this worked well only for the simplest of animations. I'll need to try it again when I have more time!

There's also a module called Celluloid, which works a bit like a camera, taking snapshots whenever the user specifies.

It's worth trying these approaches if you are already familiar with python, and try to find the one that works best for you.