Tutorial: Introduction

Mathwright32 is a mathematical and scientific software construction set. With it, you may create or read documents called Microworlds or Interactive Web Books. These documents support interactive mathematical and scientific exploration. Microworlds are created in Mathwright32 Author. Mathwright32 Author is the mathematical and scientific software construction set that is used to build the interactive Mathwright Documents that underly the Microworlds and Interactive Web Books. We call single-page HTML documents with underlying interactive document support: Microworlds, and multiple-page HTML documents with underlying interactive document support: Interactive Web Books.

Microworlds created with Mathwright32 Author may also be submitted to the Mathwright Library, a library on the World Wide Web of interactive mathematical and scientific explorations. Once in the Library, they may be freely accessed and read by anyone. When a person registers in the Web Library, using an Internet browser, she may download a free version of Library MathwrightWeb, which reads only Library books. After that, readers may select at will any of the interactive Microworlds in the Library holdings to read at home. In this way, authors may design materials that support web-based courses. The WWW address of the Library is:

http://www.mathwright.com

Mathwright32 is a system for creating mathematical and scientific interactive texts, based on Mathwright classic. It was designed by teachers, for teachers. Mathwright32 is the result of eighteen years of research and refinement, and has been used extensively in workshops on the design of interactive texts at numerous colleges and universities. During the five years of its development at the Institute for Academic Technology at University of North Carolina at Chapel Hill, it has benefited from almost continuous collaboration with teachers at the college and secondary levels.

Mathwright32 documents are multipage interactive texts (which may or may not be embedded in a web page) and may have a variety of display objects on their pages. These objects are automatically connected to one another through the underlying Mathematics Scripting Language that we document here, Mathscript. An author creates an object simply by drawing it, and later by tailoring it to her needs through its menu. Each object has its own menu of properties, and these may be modified at any time. Many of the objects may be "scripted" with their individual Scripts that are built upon both predefined and author-defined commands, programs, and mathematical objects. We call the scriptable display objects: Gadgets.

The idiom of Mathwright is transparent and simple, based, as it is, on the graphical, hypertext, and object-oriented style of windowing environments. In the most important senses, Mathwright32 Microworlds have the visual appeal and intuitive feel of the web pages on which they reside. And they are easy to create! Underneath, there is the new and versatile Mathscript mathematics scripting language.

Object Paradigm

The objects that an author may create are:

  Graph2D Gadgets. These scriptable objects display graphs of functions or curves defined by user input, solutions of differential equations, filled polygons, pictures, sprites that can be translated, rotated, or transformed by any affine transformation under program control, animations, and a variety of Logo objects such as points, lines, polygons, polylines, and so on. These gadgets may be scripted to respond to a mouse-click, or even to the motion of a mouse over them.

  Graph3D Objects. These display objects hold "scenes" that are populated by "actors". The actors are parametric and implicit surfaces, space curves or "tubes," arbitrary geometry created with OpenGL, and imported 3D models from 3D Studio or DirectX format. OpenGL is a powerful rendering language that will display your scenes and allow the user to interact with them in real time. Mathscript contains 57 primitive OpenGL commands, 47 constants and principal state variables in interactive form. This means that you (and your readers) may use OpenGL in essentially its original form (its syntax blends seamlessly with Mathscript syntax) to experiment with geometry and graphics interactively.
And since Mathscript is so tightly integrated with OpenGL, it can in fact be an excellent tool to learn and experiment with OpenGL itself. In its scripts, you will see the results of your graphics instructions immediately, however, without the need to compile them into C++. This is a great advantage for building simulations that must be fine-tuned over many incremental cycles.
But Mathscript is also a highly flexible language that allows you to create your own commands, to build your own object hierarchies, and to create the mathematical objects that will support your simulation. What distinguishes our 3D Graph Objects from other 3D Graphics environments is the fact that the "actors" in the scenes you create are dynamic. They may be moved individually either interactively (at the command line) or under the control of scripts that you write. They may be selected by the reader when she clicks on them, and may respond in appropriate ways with the full Euclidean group of motions. Further, the reader may navigate your scenes by flying through them in the first person, or by moving the entire scene itself. This makes possible a large variety of realistic experiments and simulations that it would be difficult to imagine supporting on a 2 dimensional canvas
.

  MathEdit Objects. These are designed to display mathematical expressions in an intuitive form, with raised exponents and true fractions to any order of nesting. In addition, the MathEdit windows serve as word processors, with a variety of uses. As an editor, it is used by authors to provide colorful on-line explanations of the Microworld lessons. These windows also display pictures and "snapshots" of any part of any screen. Students use them to create and save their reports or notes. In Mathwright32 Reader, students may create and save files for these objects, and recall them at any later time, thereby customizing the text without actually changing it. MathEdit windows also display matrices and can be used as an interface for the input of matrix or of algebraic expressions.

  DataTable Objects. For the input and output of tables of numeric, string, or function data, the data windows provide small "spreadsheet" environments. The columns of these windows are Mathscript vectors, and so they may be used in any calculation on vectors. For example, they may produce scatter plots or bar charts in Graph2D windows at the click of the mouse. String columns may be used to build Lexicons, and so on. Also, these data tables are Microsoft Access Active Data Objects, and so may be queried with SQL queries, saved to disk and retrieved later.

  TextBox Objects. These are the work horse objects of Mathwright32, used principally for multiline text input and output. With the Enter command, they allow the user to define programs, commands, and full scripts interactively.

  TextLine Gadgets. These scriptable objects are single-line text fields. They are used mainly for input. Their scripts are run when the user presses Enter at the end of the line. Text does not scroll.

  Command Line Objects. These multiline text fields are also mainly for input. The player may enter any of the predefined or user-defined commands of Mathscript and the command is executed when the user presses Enter at the end of the line. This is an excellent place to define functions and short commands, to set values for variables, and so on.

  Program Listeners. These objects are associated with any scriptable gadget, or with a page, or with the document itself. Use these to compose scripts, define programs and commands, to test and debug scripts, or even to program in LISP. The scripts created here may be saved to files, or may be saved with the object to which they are attached.

  Label Objects. These provide static text for the background page, such as instructions.

  HotSpot Gadgets. When a page has wallpaper (a .gif, .jpg, or bitmap background) then it may have associated with it any number of invisible, non-overlapping rectangles. When the mouse is moved over a hotspot, the cursor changes to a "pointing finger". When the reader left-clicks the mouse on a hotspot, the script for the hotspot is run.

  Button Gadgets. These are scripted gadgets that respond to the left mouse-click by running their scripts.

  Slider Gadgets. These are input gadgets that allow the reader to input numbers in some interval, either in a continuous or discrete fashion. They may also be scripted, so that any motion of their thumb causes the script to be run.

  CheckBox Gadgets. These are input and output gadgets for Boolean data (True or False). They may also be scripted so that their activation causes an arbitrary script to be run.

  Language Objects in the Lexicon.

  Of course, the most important objects in a Mathwright32 Document are the language objects. These are created by authors in Mathwright Document Scripts or Page Scripts, or, in the case of more complex objects, in File Scripts. They may also be created interactively by readers in Command Lines or TextBoxes (using the Enter Command). Those things will be discussed later, but they include the following types: Commands, Programs, and Mathematical Objects. These global objects are visible to all the pages of the document. Each command, program, or mathematical object has a name. The name is an alphanumeric sequence (including underscores) that begins with a letter, and should not exceed 32 characters in length. All of the objects in a book may be browsed - with their current definitions -- in the Lexicon which is viewable in the Objects Menu.

  All single letters: a,b,c, ... x,y,z with the exception of d and e are initially the names of variables. "d" is the name of the partial differentiation function, and "e" is Euler's number. Authors may define and attach commands, programs, functions and mathematical objects to their texts. We describe the basic object types now.

Commands: These include the built-in and User-defined command statements (such as Graph, Surface, Plot, Solve, etc) that may be executed from a command-line or in scripts.

Programs: These are the User-defined program definitions. They usually return values, and accept parameters. They may be called from a command-line or in scripts.

Mathematical Objects:

The types of mathematical objects in Mathscript are given below. In the relevant cases, the arithmetic and representation are either exact rational, or decimal, at the author's choice.

All but constants may be created by authors or readers.

Multimedia and Hypertext Idiom:

  The Microworlds in Mathwright support the graphical and hypertext idioms that are emerging with increased popularity and success on the Internet. The Microworlds (as well as their underlying Mathwright Documents) are paginated. Each screen is a page conceptually, although it may contain within it scrolling screens of arbitrary length. Navigation from page to page (or Microworld to Microworld) is usually accomplished through the use of "hotspots" or "push buttons," or other types of scripts under program control.

  Additionally, Mathwright Documents utilize a number of "multimedia" features that can color and enrich a learning environment. Among those are:

Collections of display objects and scripted gadgets, arranged on the pages of a Microworld, define dynamic and genuinely interactive teaching and learning environments that can be used for private study, in laboratories or classrooms, and in web-based teaching/learning environments. As a mathematics scripting language, Mathscript attempts to be both expressive and flexible enough to give authors and readers the opportunity to translate their ideas into actions in a natural and informal way. The colloquial style of Mathscript captures much of the idiom of conventional mathematical language, while maintaining contact with the semantics of the underlying operations and constructions in Algebra, Geometry, Combinatorics, and Analysis.

This strategy has as its aim to encourage authors to "try things" that might be too daunting in more restrictive language environments, and to encourage learners to ask their own questions as they read the pages of an interactive text. Mathscript implements this strategy in two ways, both closely tied conceptually to the use of Objects. First, Microworlds are populated by mathematical objects. These objects are created by authors, or are predefined by the language. New objects may be added at any time by author or reader, and these objects may be manipulated by all of the user-defined or built-in commands, programs, or messages of the environment.

Objects may have arbitrary lists of properties that are defined by the author. Authors may also define for their Microworlds new classes or types of objects, together with methods that determine how those objects respond to messages. Thus, the elements of Mathscript are conventional mathematical objects such as rational numbers, functions, vectors, matrices, vector fields, polyhedra, and so on. And they may include special-purpose mathematical objects created by the author, such as sets or sequences.

It is natural to construct such objects, to transform them in meaningful ways, to compare and to combine them according to the conventions that we teach, and to observe the results from different viewpoints. These objects enjoy first-class citizenship in Mathscript. To a large extent, "mathematically natural" operations on these objects, in the sense of the conventional mathematical idiom, are available or constructible in Mathscript syntax. Second, as a language, Mathscript was developed to take full advantage of the visual and object-oriented windowing idiom with which it is articulated. Thus the integration of language constructs with display objects and gadgets makes it easy for teachers and students to perform these mathematically natural actions in a rich variety of ways.

Mathwright Microworlds are intuitive and object-oriented. Using the metaphor that relates a "screen" to a "page", the author creates paginated interactive mathematical texts as hypertext documents. The "pages" of these documents are decorated with text, gadgets, wallpaper, and mathematical display objects. Navigation from one page to another may be controlled by buttons, hotspots, or by run-time conditions (such as reader response to questions). Pages can be easily copied from other texts, and inserted into a new Microworld. They retain all of their functionality.

Object Oriented Environment and the Object Hierarchy

By "object-oriented" we mean that conceptually the author builds her Microworld from the top down, creating actual objects at each level where they are needed and when they are needed. At the top level is the Microworld itself. Below that is the Page. A Microworld is an ordered collection of pages. Below the level of page, are the Display objects, wallpaper and hotspots, and Gadgets that decorate the page. Also below the level of Microworld is the Lexicon of commands, programs, and mathematical objects that are available to all the pages. A page is a collection of display objects, gadgets, wallpaper and hotspot objects.

Each object at a given level has its individual and distinctive attributes, but all objects at a level share the same generic properties: they process the same messages from other objects through the Mathscript Language, and stand in the same relationship with objects above or below them in the hierarchy. This object idiom is also intuitive and visual. Thus, authors invariably find it easy to build their documents in simple steps: screen by screen, object by object, and script by script, so that the testing and refinement cycle is relatively painless.

For example, authors quickly learn to insert pages of existing documents into their books, and then to modify them for the functionality they desire. This means that it is easy for authors to customize the documents for their students, taking into account the students' learning styles and abilities, and especially considering the "contexts" in which the students will undertake their mathematical and scientific investigations. In fact, authors often approach the creation of documents in a playful, experimental way.

How to use this Tutorial

The main reference for the underlying Mathwright32 system are the online Help files: Mathwright32 Reference and Lisper Help. They contain a detailed discussion of all of the elements of the system. All of these will be useful at various stages, as you become familiar with the Mathwright32 system. We recommend that you begin your exploration of Mathwright32 with this tutorial.

The tutorial does not give the detailed and encyclopedic description of the Mathscript language, and of the properties of objects that you will find in the remainder of the Help document. Instead, it is a tutorial on the overall design of Mathwright32. It begins with a discussion of how to install Mathwright32 on your computer.

That discussion is followed by a sequence of projects. You should step through that sequence of projects in order. By the end of the second project, you will have created several simple (one page) Mathwright Microworlds. And by the end of the last project, you will be familiar with most of the authoring features of the program.

At that point, you will be ready begin to create your own projects and to install them on your web pages. When you create a Microworld, you have the option of posting it on your web page and distributing it to your readers, or of delivering it as a zipped archive for them to download from your page and read in Mathwright32 Reader. In either case, the Personal MathwrightWeb Control and the Mathwright32 Reader are free downloads from the Library that you may pass on to your readers.

The final section of this tutorial, Packaging and Delivering your Microworld, explains the simple steps to take to make your books available to readers.