Animated graphics in mathematics education

As far as I know, there’s been little research done on this topic, although it seems to me that animations could be enormously helpful in facilitating the learning of some mathematics. Think, for example, of the “limit of secants” method for defining a derivative:

\displaystyle{f'(a)=\lim_{x\to a}\frac{f(x)-f(a)}{x-a}}

I know that when I teach elementary calculus I draw a curve, and try to show by means of diagrams that as x slides along the curve to a, the secant “approaches” the tangent to the curve at a. Some students, if not fully convinced, give the impression that there is merit in this argument; other students sit there with their “when will this be finished?” look on their faces. This seems to be a place where some interactive or animated graphics would be very helpful.

Most computer algebra systems now provide some support for animation; if they don’t they should. Interestingly, when CAS’s are compared, graphics usually are not considered. Way back in the late 1990’s, when Michael Wester was producing his monumental review of CAS’s (of which an earlier version can be found here), they were treated as problem solving black boxes: problem goes in; solution comes out. The best CAS was the one which solved (correctly!) the greatest number of problems from the broadest number of topics. And this style seems to have permeated CAS comparisons ever since. As far as I know, very few reviews have investigated the graphics capabilities of such systems. One which did was Barry Simon’s “Symbolic Math Powerhouses Revisited”, which is available as the first chapter in Wester’s Computer Algebra Systems, A Practical Guide.

I think that most mathematics educators are simply unwilling to come to grips with the technology which enables such graphics to be produced, but in fact most modern software makes this very easy.

As an example, I’m going to show how to produce a cycloid in Sage. Sage contains an “animate” command, which simply runs though a list of graphics objects, displaying them one after the other. To draw my cycloid, I’m going to need three such lists:

  1. The moving circle.
  2. The point on the circle’s circumference.
  3. The cycloid as drawn by that point.

And of course I need the equation of the cycloid, which is easiest given parametrically:

x=t-\sin(t)
y=1-\cos(t)

So here’s how to produce the three graphics objects above:

step = 0.3
v = []
for t in srange(0,2*pi,step):
    v.append(circle((t,1),1))
a = animate(v, xmin=-1, ymin=0, xmax=8, ymax=2, figsize=[9,2])

There should be no surprises here; “v” is a list, which is filled up with circles all with different centres. And the points:

w = []
for t in srange(0,2*pi,step):
    w.append(point((t-sin(t),1-cos(t)),pointsize=20))
b = animate(w, xmin=-1, ymin=0, xmax=8, ymax=2, figsize=[9,2])

Note here we use the parametric equations to plot the points. And finally the cycloid itself: we draw it as a sequence of lines from the previous to the current point:

L = Graphics()
x = []
for t in srange(0,2*pi,step):
    L += line([(t-step-sin(t-step),1-cos(t-step)),(t-sin(t),1-cos(t))], rgbcolor=(1,0,0), thickness=2)
    x.append(L)
c = animate(x, xmin=-1, ymin=0, xmax=8, ymax=2, figsize=[9,2])

To display this animation, we simply display all of a, b and c together:

(a+b+c).show()

You can see the animation here.

Now that wasn’t so hard, was it?

3 Responses

  1. Nice demonstration, and while I’m certainly not disagreeing with you that mathematics educators could make better use of technology (in general) it has to be done carefully.

    I remember teaching sorting techniques (bubble sort, insertion sort, quick sort etc) and one of my higher level students showed me a lovely animation of the various types of sort. But apart from the most obvious aspects (i.e. that quicksort is quick) it turned out that the animation, even running fairly slowly, only made sense to the students who had already grasped the ideas behind that particular sorting technique. To the others, it was just a blur of moving bars.

    Gordon

  2. Thanks for bringing up the subject. I’m a student in engineering with a degree in physics and, despite the inherently physical nature of the math we use, was shown very few graphics related to the material I was learning.

    On my own initiative, I have learned how to use sage and have found it to be very useful. I would love to see a program like sage (my preferred math program) be taught to younger children so that when they have a problem, they can quickly animate it themselves to see what’s “going wrong” or what an expression “actually means.”

  3. Hello;

    This is a nice animation example! I liked it, so I implemented it in Mathematica as well.

    Here is the Mathematica code

    r = 1; step = 0.1;
    backgroundAxes = Plot[0, {x, -Pi, 3*Pi}, PlotRange -> {Automatic, {-r/2, 2*r + 0.5}},
    AspectRatio -> Automatic];

    Animate[Show[{backgroundAxes, ListPlot[Table[{x - Sin[x], 1 – Cos[x]}, {x, 0, t, step}], Joined -> True],
    Graphics[{PointSize[Large], Red, Point[{t - Sin[t], 1 – Cos[t]}]}], Graphics[Circle[{t, 1}, r]]}],
    {t, 0, 2*Pi, step}, AnimationRate -> 5]

    I exported the above to an animated GIF, here it is

    http://12000.org/my_notes/simulation/animating_moving_circle/test.GIF

    –Nasser

Leave a Reply