Mathscript
is the LISP-based, object-oriented computer algebra and graphics language used
for all Mathwright Microworlds and Mathwright Interactive Web Books.
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.
Mathscript
is implemented in LISP on top of Java. With it, you may read Mathwright
Documents either in your web browser (for Microworlds or Interactive Web Books)
or offline.
These Mathwright Documents support interactive mathematical
and scientific exploration. Mathwright Documents are
created in Mathwright32
Author. And
Microworlds may be read in ActiveX enabled browsers on the web with MathwrightWeb,
or they may be read offline in the application:
Mathwright32 Reader.
Mathwright,
the original 16-bit
system for creating mathematical and scientific interactive texts, was designed
by teachers, for teachers. The current 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 inception at the Institute for Academic Technology at
University of North Carolina at Chapel Hill, it benefited from almost continuous
collaboration with teachers at the university and secondary levels. Mathwright32
is upwardly compatible with Mathwright, and the accompanying translator and
compiler will translate Mathwright WorkBooks (.imt files) to Mathwright32 documents
(.lva files).
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 Mathwright32 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
documents have the visual appeal and intuitive feel of the web pages they inhabit.
And they are easy to create! Underneath, there is the Mathscript scripting language,
which is dedicated to providing a simple and colloquial way to translate your
ideas into living
interactive stories.
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, 19 Actor manipulation functions, and all relevant 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.
Functions (These
take arguments and return values)
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:
Midi
Sound Play Midi music (.mid
files)
under program control.
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, Mathwright
Documents are populated with
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.
Mathwright32
Documents and their Microworlds and Interactive Web Books 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, hyperlinks on web pages, 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
Mathwright32 Document 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 Mathwright32
Document itself. Below that is the Page. A Mathwright32 Document 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 common
to all pages
is the Lexicon of commands, programs, and mathematical objects that are available
to the Mathwright32 Document. A page is a collection of display objects, gadgets,
and language 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.
In
this Help document, we discuss the two aspects of Mathwright32 documents separately.
First, we spend a fair amount of time describing the nearly 300 built-in commands,
programs, and functions that make up the Mathscript Language. We supply
listings by object-type and by functionality to give an overview of what is
possible. Next, and in a separate section (a Tutorial) we discuss the elements
of screen design and document structure that connect the Display Objects
and Gadgets to the Language.