You are here

Introducing Mathwright Microworlds - An Epicycloid Microworld

James E. White

Now we consider another microworld embedded in a single web page, one for which persistence of data is a useful feature. The Epicycloid microworld has just two story pages. It is designed so that readers can compare two very different ways of constructing these curves. We also begin to consider what is involved in building microworlds like these.

Imagine that you are creating a mathematical web page about epicycloids. You put careful thought into its design, and you decorate the page with instructional text, pictures, forms, hyperlinks, and whatever other HTML gadgets you find useful for telling your story. You then have a hypertext mathematical story with the additional important property that it is linked to a vast collection of other mathematical stories on the World Wide Web. You make the observation that a certain geometric construction yields a family of curves parametrized by a and b:

But something is missing. Readers cannot do experiments or ask "what if" questions. The demonstrations and arguments are as static as they have always been in mathematics texts -- perhaps more colorful, but still static. A student may ask "What does the graph of the cycloid look like if I make the a parameter negative instead of positive?" Unless you have provided an example, or a pointer to a page that has one, the student will not learn the answer here. HTML was not designed to provide the support you need. The equations above are only a picture with no "life" or meaning in the page. What you want is an added dimension of interactivity .

So you say, "I can provide this interactivity with a Java applet," and you go to work. You know that Java is a very powerful computer language, so it will certainly be possible to do this. And you were not misinformed: Java is powerful. But you learn a sad truth: Java is a general-purpose language, not a mathematical language.

Creating a Java Applet from scratch that can support exploration with cycloids can be daunting. We could start with the parametric expression for the curve given above. The Applet would have to accept the parameters a and b from the reader -- easy enough! -- and then draw the curve. This is still fairly easy to do in Java. The simple two-page Microworld below is, on its first story page at least, essentially a Java Applet It invites readers to experiment with parameters a and b, and it draws the graphs for them when they press the "Draw the Cycloid" button. Then, if the reader presses the "Animate" button, it shows how such a cycloid can be constructed by rolling one circle on another without slipping, tracing the path of a point on the circumference.

Such things are fairly easy to do with Java applets, but the reason we do not see more of them is that they do take time. One usually has to start from "first principles" to make a simple demonstration like this. Even if one has access to a good class library, it is necessary to tweak and modify the code at a very concrete level in order to get it to work. Such a project might take days -- more likely weeks -- using Java alone.

But the two-page Microworld on this page required only two to three hours to write. It is based on earlier work by Mathwright authors Mike Pepe (Seattle Central Community College) and Samuel Masih (Albany State University). The reasons it was so easy to write:

  • The screen design required only a few minutes of drawing. Once that was done, all that remained was to "script" the screen objects -- buttons and pages in this case -- using Mathwright's high level scripting language called MathScript.
  • With Mathwight Library's Open Source convention, some of these scripts were already available in earlier workbooks at the Library, so all that was needed was to "tweak" and extend them to work for this microworld.

Unlike Java (or any general purpose computer language), MathScript treats mathematical objects, their transformations, comparisons, and presentations, as first-class citizens of the language. So it is easy for authors to translate their mathematical ideas quickly into working code. We will say more about that later.

This is the portal.  The white sidebars are not part of it.

A demonstration like this is designed to raise questions.

What if a divides b?
What if one is negative (or both are)?
What is the relation of a and b to the radii of the circles? and, of course,
How is this construction related to the formula above?

Some of these questions might occur to one student and not another.

At some point, a student might be interested in the question:

When do these curves close, given that t varies from 0 to 2 pi?

Another student might recognize the 1-homogeneity of the formula: If a and b are multiplied by the same positive factor, this only changes the scale of the curve by that factor. This student might connect that fact to the invariance of form when the circles are so treated.

The observation on the right is the point of departure for story page 2 of the Microworld. Notice that if a and b are both positive and a divides b, then we can factor a out of the expressions for x(t) and y(t) to get

Suppose we let   be the integer n, and we represent a general point on the unit circle, using Euler's Formula, as

Then the points on the curve just described may be represented in the complex plane as

Thus, we have a different interpretation of these epicycloids as images of a unit circle in the complex plane under certain degree-n complex polynomial maps. On story page 2 the reader is invited to explore this fact and to move back and forth between the pages to compare the resulting graphs.

The style of mathematical calculation and the nature of the exploration on the second page veer off in a new direction. Now it is a matter of applying complex polynomials to circles. The built-in complex/quaternion number type in MathScript makes this easy. It leads of course to a nice way to visualize complex polynomials from their mapping properties. And while this connection takes only moments to occur to an author, making this facility available to readers, even in this limited generality (arbitrary complex polynomials applied to circles) would be difficult and time-consuming if implemented directly in Java.

In the next section, we discuss in more detail the issues facing web authors of interactive mathematics explorations and some of the new options open to them with Mathwright Microworlds and Mathwright Interactive Web Books.

James E. White, "Introducing Mathwright Microworlds - An Epicycloid Microworld," Loci (December 2004)


Journal of Online Mathematics and its Applications