A function plotter for teaching calculus to children
Click on the screen-shot to enlarge
Abstract
This article presents a function plotter program for teaching calculus
to children. Specifically it teaches real-valued functions of a
single real-valued variable. On the right of this screen is a
screen-shot of the program running. The program is freely available
as a
Windows Executable
under the GNU General
Public License. If you also want the C++ source code, then
please email me. This program has
been superseded by a later
program.
1. How to use this program
The function in the screen-shot on the right was plotted by entering
the following in the console at the bottom of the screen:
sin(x * 10) + sin(x * 11)
Features of the program include:
Arbitrary functions can be composed in a way that is similar to
the operation of most modern scientific calculators. Specifically,
the following operators are supported: addition (+), subtraction
(-), multiplication (*), division (/), exponentiation
(^), brackets ( ... ) for grouping and seven built in
functions:
sin, cos, tan, exp, log,
sqrt, and abs plus the built-in constant PI
(also known as π).
Unlimited zoom in / out.
Derivative mode plots the first and second derivative in the same graph as the function being plotted.
Integral mode plots the integral in the same graph as the function being plotted.
Control of the program is achieved by a DOS-style console,
complete with a history of all previous commands (available with
Cursor Up/Down) so that it is easy to go back to a function
that was plotted earlier. The command line can also be edited with
the following familiar keys: Cursor Left/Right, Backspace, Delete,
Home and End.
Because this program is intended for children, I have left out
features that might be confusing to them. In keeping with this
philosophy, the derivative and integral features of the program are
turned off by default.
2. Motivation for the program
While I was in high school
I wrote a program in Microsoft Amiga Basic that could plot
arbitrary real-valued functions of a real-valued variable, which I
found useful to learn calculus. As my understanding of computer
science was limited, it was necessary to change the source code of the
program every time you wanted to print a different function. It is
only now with my greater understanding that I am able to revisit this
problem and rewrite the program in C++ so that it can compose
functions at run-time.
3. How to download
The program is available as a
Windows Executable
The download size is approximately ½ megabytes, which should
take just over 2 minutes to download on Dial-up Internet, and even
less with broadband! This program was written using a
cross-platform graphics library known as
Allegro, so in
theory it should be possible to compile this program on other
platforms such as GNU/Linux and MacOS.