\documentclass{article}

\title{Applets for Interactive Exploration of Electric and Magnetic Fields}

\author{Michael Malak\thanks{Email: malakm@rpi.edu}\\
Department of Mathematical Sciences\\
Rensselaer Polytechnic Institute\\
Troy, NY 12180, USA}

\date{April 16, 1999}

% Notes to transcribers:

% There are really only a few funny macros in the text.
% Here are explanations:
%
% \graphic makes a floating figure from a graphics file.
% Its syntax is
% \graphic{filename.gif}{Caption text for this
% figure.}{latex_reference_name_for_ref_and_pageref}
%
% \url{http://whatever.rpi.edu/} typesets a URL.  (It actually tries
% to make that URL text into a hyperlink, too, if you can do that.)
%
% \docLink and \href make hyperlinks.  The syntax is
% \docLink{http://whatever.rpi.edu/}{link text}  (\href is similar.)
%
% \oiint makes a closed-surface-integral symbol.

% Particularly in the reference section, there may be some handmade
% line breaks, especially within URLs.  Go ahead and fix these.

% You can probably ignore everything from here up to \begin{document}.

% -Michael Malak

% We might want to display this with IBM techexplorer.
% The following definition will be ignored by techexplorer.
\newif\iftechexplorer
% This will also be ignored; there is an implicit \techexplorertrue
\techexplorerfalse

% Most of the illustrations are GIF images.
% There are two PostScript pictures.  The techexplorer can't handle
% them, so they have equivalent GIF images inside an \iftechexplorer
% switch.  The techexplorer can handle GIFs without any help.
% For LaTeX, we will add a rule for GIFs that reads an additional file
% with ``bounding box'' information.
% The Gif-to-PS translator must obey the following rules:
% 1.  The picture is scaled so that each pixel measures 0.01 inch.
% This works well for 100-dpi screens and 300- and 400-dpi printers.
% 2.  The PostScript picture is located in the lower left corner of
% its ``page''.  So if an image was 512 pixels wide and 432 pixels
% high, the bounding box of the PostScript would be [0 0 5.12in 4.32in].
\iftechexplorer\else
\usepackage{graphicx}
\DeclareGraphicsExtensions{.gif}
\DeclareGraphicsRule{.gif}{eps}{.gif.bb}%
% Uncomment one of the next two lines, depending on what you have.
%{`giftopnm #1 | pnmdepth 255 | pnmtops -nocenter -noturn -scale 0.75\space}
{`convert -density 100x100 #1 EPS:-\space}
\fi

% You don't want to know about this; it's what I used for drafts.
% Maybe you do.  You can write to me.
%\usepackage[binary]{image}
%\graphicspath{{../../../public_html/Thesis/}}

\iftechexplorer
\newcommand{\caption}[1]{{\centering#1}}
\newcommand{\cite}[1]{\docLink{\bibliographyfile}[::BibItem::#1]{$[\Box]$}}
\newcommand{\url}[1]{\docLink{#1}{\texttt{#1}}}
\newcommand{\mathscr}{\mathcal}
\renewenvironment{abstract}{\section*{Abstract}}{}
\newcommand{\graphic}[3]{\begin{figure}
\begin{center}
\fbox{\includegraphics{#1}}
\end{center}
\caption{#2}\label{#3}
\end{figure}}
\newcommand{\graphicp}[3]{\graphic{#1}{#2}{#3}}
\newcommand{\oiint}{\oint\!\!\oint}
\def\basepage{http://links.math.rpi.edu/modules/electromagnetism/}
\def\modulehref#1#2{#2} % fill this in later
\def\modulesection#1#2#3{\section{#2}\label{#3}}
\else
\usepackage{mathrsfs}
\usepackage{url}
\newcommand{\graphicp}[3]{\graphic[p]{#1}{#2}{#3}}
\newcommand{\graphic}[4][htbp]{\begin{figure}[#1]
\begin{center}
\fbox{\includegraphics{#2}}
\end{center}
\caption{#3}\label{#4}
\end{figure}}
\newbox\displayiintbox
\setbox\displayiintbox\hbox{$\displaystyle\int\!\!\!\int$}
\newlength\dibaxisheight
\setlength\dibaxisheight{0.5\ht\displayiintbox}
\addtolength\dibaxisheight{-0.5\dp\displayiintbox}
\newbox\displayobox
\setbox\displayobox\hbox{\makebox[0 pt][l]{%
\hspace*{0.5 \wd\displayiintbox}%
{\setlength\unitlength{0.9\wd\displayiintbox}\thinlines%
\raisebox{\dibaxisheight}{\begin{picture}(0,0)%
\put(0,0){\oval(1,0.6)}%
\end{picture}}}%
\hspace*{-0.5 \wd\displayiintbox}}}
\newbox\textiintbox
\setbox\textiintbox\hbox{$\textstyle\int\!\!\!\int$}
\newlength\tibaxisheight
\setlength\tibaxisheight{0.5\ht\textiintbox}
\addtolength\tibaxisheight{-0.5\dp\textiintbox}
\newbox\textobox
\setbox\textobox\hbox{\makebox[0 pt][l]{%
\hspace*{0.5 \wd\textiintbox}%
{\setlength\unitlength{0.7\wd\textiintbox}\thinlines%
\raisebox{\tibaxisheight}{\begin{picture}(0,0)%
\put(0,0){\oval(1,0.7)}%
\end{picture}}}%
\hspace*{-0.5 \wd\textiintbox}}}
\newcommand{\oiint}%
{\mathord{\mathchoice{\copy\displayobox}{\copy\textobox}{}{}}%
\mathord{\int}\!\!\!\int}
\fi

% There are a couple of hyperlinks in this document.  We have three
% possibilities for them:
% 1. Use techexplorer, and make them live.
% 2. Use hypertex, and make them live.
% 3. Don't use anything; just typeset the anchor text.
% We use the \docLink{url}{anchor text} macro.  We may need to line-break
% the anchor text by hand using \urlbreak.
% So:
\iftechexplorer
\newcommand{\urlbreak}{}
% \docLink is a bit flaky if the URL contains ~ or %, but ours don't.
\else
%%%% Change the following to \iftrue to use hypertex.
%%%% Change the following to \iffalse to not use hypertex.
\iftrue
\usepackage[dvips]{color}
\definecolor{maroon}{rgb}{.5,0,0}
\usepackage[dvips,colorlinks=true,linkcolor=maroon,citecolor=maroon,
urlcolor=blue,filecolor=blue,pagecolor=blue,pdfpagemode=None,
pdfpagescrop={116 126 496 726},
pdftitle={Applets for Interactive Exploration of Electric and Magnetic Fields},
pdfauthor={Michael Malak},
pdfsubject={Electric and Magnetic Field Explorer Applets},
pdfkeywords={Studio Physics Electromagnetism Field Applet}]{hyperref}
\newcommand{\docLink}[2]{\href{#1}{#2}}
\newcommand{\urlbreak}{\\\relax\hspace*{1.0 em}}
\else
\newcommand{\docLink}[2]{#2}
\newcommand{\urlbreak}{\discretionary{}{\kern 1.0 em}{}}
\fi
\fi

%\iftechexplorer\else
%% (not tested)
%\let\oldmaketitle\maketitle
%\def\maketitle{%
%  \let\oldnewpage=\newpage  
%  \let\newpage=\relax       
%  \vspace*{-\baselineskip}% 
%  \vspace*{-3\baselineskip}%
%  \oldmaketitle    
%  \let\newpage=\oldnewpage  
%}
%\fi

%\pagestyle{empty}
%\thispagestyle{empty}

\begin{document}

\maketitle

Version \#1

\begin{abstract}

The World-Wide Web and Java-equipped browsers enable us to create
interactive hypermedia class materials and to distribute them easily
to a studio class.  One use of Java applets is for the visualization
and exploration of electric and magnetic fields.

\end{abstract}

\section{Background and Rationale}

The World-Wide Web, with the addition of the Java language, provides a
simple and portable way to create and distribute interactive
hypermedia learning material.  This combination of technologies has
many advantages.

It had previously been the case that in any computerized classroom,
such as a studio classroom\cite{wilson_studio}, each computer had its
own copy of the courseware.  Any revision to this courseware required
the changed files to be propagated to every computer that would use
them.  This made it inconvenient to keep all copies of the courseware
up to date.  The World-Wide Web provides a way to remedy this
problem.\cite{novak_patterson,networked_physics} Only one copy of a
file needs to exist, and it may in fact be kept on a server far from
the classroom where it is used.  This way, when a file is revised,
only the copy on the server must be replaced.  The students view the
class materials using a Web browser such as Netscape Communicator or
Microsoft Internet Explorer, both of which are freely available.

Unfortunately, the Web brings its own problems to the classroom.  One of
these is the lack of support for mathematical equations.  The
HyperText Markup Language (HTML), the standard markup language used on
the Web, has no built-in support for mathematics.\cite{w3c_mml} This
can be solved, though not entirely satisfactorily, by rendering equations
into bitmap images, by using an equation-drawing applet like
WebEQ\cite{webeq}, or by using a ``plug-in'' like IBM's
techexplorer\cite{techexplorer}.  Simple expressions can even be
typeset in the HTML with an italic font and images of the Greek
characters.  None of these is a good, portable, long-term solution,
but they do work, and there is hope that in the reasonably near
future, a usable and comprehensive standard will be adopted.

The other, more profound limitation has been the inability of a web
page to be interactive.  It is not particularly useful for a student
to merely be able to read text on a computer; the textbook is much
more nearly complete and easier to refer to.  The computer should
offer \textsl{interactivity}, but until 1997, HTML and the Web
browsers that used it allowed only text (that is, \textsl{hyper}text)
and images.

Other multimedia presentation formats (like ToolBook, in which CUPLE
is written) allow the author to include in a page a simulation or
non-static illustration that the student can interact with.
Typically, the student can move objects or change settings and watch
the change in the physical system being modeled.  This interactive
behavior was not possible in documents written in HTML, although there
was a limited ability to show animation.

The advent of the Java language\cite{java}, which is
platform-independent and freely available for education, added
interactivity to the page, while still using the advantages of the
World-Wide Web.\cite{christian} The HTML standard, and most browsers
now, allow an author to embed into a web page a type of Java program
called an \textsl{applet}.  An applet runs under tighter security
conditions than a free-standing program (an \textsl{application}), but
otherwise, it can do anything that an application can do.  In
particular, an applet can serve as an interactive illustration in a
web page of courseware.  The tighter security usually has little or no
effect on interactive illustrations.  I have developed several such
applets for Physics II, Rensselaer's first- or second-year course in
electricity and magnetism, and they are available from the Project
Links\cite{links_cip} website at
\url{http://links.math.rpi.edu/devmodules/electromagnetism/}.  The
applets are also suitable for a higher-level electricity and magnetism
class, and those applets concerned with fields can also be used in a
class on vector calculus.

\section{Field Explorers}\label{field_applets}

The Electric and Magnetic Field Explorer applets (``Field Explorers''
or ``field applets'') used in Rensselaer's Physics II course
illustrate the advantages of the HTML/Java approach.  The Field
Explorers are a set of two similar applets that let a student
investigate properties of electric and magnetic fields.  The screen
represents a plane in space with field sources embedded in or running
through it.  Often the sources are infinitely long and perpendicular
to the plane, and are seen as cross sections, as represented in
figure~\ref{threedpic}.  At present the sources cannot be moved or
reconfigured.  The sources are configured in the HTML file, as is the
behavior of the applet as a whole.

\graphic{gauss2d_pc.gif}{Field Explorer's infinitely long sources}{threedpic}

Figure~\ref{applet_html_text} is an example of a field applet embedded
in the HTML text of a web page.  All applets begin with an
\texttt{<applet>} tag with several attributes.  The \texttt{codebase}
gives the location on the server of the Java class bytecode files or
of the Zip or Jar (Java archive) file containing the class files.  The
\texttt{code} gives the name of the applet class; in this case the
applet is an Electric Field Explorer applet (see
section~\ref{field_applets}), the Java class's name is
\mbox{\textit{links.applet.fieldapplet.ElectricFieldApplet}}, and it
will be in
\mbox{\texttt{links/applet/fieldapplet/ElectricFieldApplet.class}} in
the archive file or in the code base directory.  The \texttt{archive}
gives the name of the archive file that contains the class files and
images.  An archive is not necessary, but it is desirable because
there are over two dozen class files used by this applet.  The
\texttt{height} and \texttt{width} are the pixel size of the applet on
the page.

The \texttt{<param>} tags are used to pass parameter strings to the
applet.  Their interpretations are applet-specific; the parameters for
the Field Explorer applet will be explained below in
section~\ref{field_applets}.  The text that is not part of any tag
(``\ldots\texttt{Complain vociferously}\ldots'') will be printed by a
browser that does not understand the \texttt{<applet>} tag.  Such
browsers are useless for these modules (and indeed all of Project
Links) but they are no longer common.  The text will be ignored by a
browser that can run the applet.  Finally, the applet text concludes
with the ending \texttt{</applet>} tag.

% This is a pretty long figure.  I have arranged for it to go on a
% separate page here; you could put it in a box or something like that.
\begin{figure}[p]
\begin{center}
\iftechexplorer\else\small\fi
\def\x#1{\hfil\rm#1\quad\>}
{\tt
\begin{tabbing}
00\quad\=\kill
\x1 <applet \=codebase="../../code/"\\
\>\>\rm Where the Java class files are located\\
\x2
\>code="links.applet.fieldapplet.ElectricFieldApplet.class"\\
\>\>\rm The name of the applet class\\
\x3        \>archive="fieldapplet.jar"\\
\>\>\rm The name of an archive containing all the class files\\
\x4        \>width="400" height="300">\\
\>\>\rm The size of the applet on the HTML page\\
\x5 <param name="source0" value="Linecharge, 50, 230, 1">\\
\>\rm This source is a line charge at $x=50$, $y=230$ with $\lambda=1$.\\
\x6 <param name="source1" value="Linecharge, 350, 50, 2">\\
\x7 <param name="source2" value="Linecharge, 200, 150, -1">\\
\x8 <param name="source3" value="CylinderCharge, 50, 50, 2, 40">\\
\>\rm This source is a uniformly charged cylinder,\\
\>\rm centered at $x=50$, $y=50$, with $\lambda=2$ and $R = 40$.\\
\x9 <param name="source4" value="CylinderCharge, 350, 230, -1, 40">\\
\x{10} <param name="showsources" value="true">\\
\>\rm Should the applet display the field sources?\\
\x{11} <param name="loops" value="true">\\
\>\rm Should the student be able to perform loop integrals?\\
\x{12} <param name="surfaces" value="true">\\
\>\rm Should the student be able to perform surface integrals?\\
\x{13} <param name="curlmeter" value="true">\\
\>\rm Should the student be able to use the curl meter?\\
\x{14} <param name="divmeter" value="true">\\
\>\rm Should the student be able to use the divergence meter?\\
\x{15} <param name="fieldlines" value="true">\\
\>\rm Should the student be able to draw field lines?\\
\x{16} <param name="equipotentials" value="true">\\
\>\rm Should the student be able to draw equipotential lines?\\
\x{17} Your browser doesn't support Java.  Complain vociferously.\\
\>\rm This will be printed if the browser doesn't support Java.\\
\x{18} </applet>\\
\end{tabbing}}
\caption{HTML text for a field applet.}
\label{applet_html_text}
\end{center}
\end{figure}

Each source is an object which, when given a point in the plane, can
calculate its own contribution to the field at that point, as well as
the field's potential, if any, and its curl and divergence.  The
applet then finds the net field (or curl, \ldots) at a point by adding
up all the sources' contributions.  The sources on lines 5--9 of
figure~\ref{applet_html_text} are sources of electric field; line 2
says that this is an electric field applet.  There may be up to ten
sources (\texttt{source0} through \texttt{source9}) listed.  This
restriction to ten sources is arbitrary but not particularly onerous
in practice.  The first ``word'' in the \texttt{value} of a
\texttt{source} gives the type of source (see tables \ref{esources}
and~\ref{msources} for lists of available sources), and the succeeding
numbers are interpreted as follows: the first two numbers are the $x$
and $y$ position of the source or its center, measured in pixels
rightward and downward from the upper left corner.  The third number
is the ``strength'' of the source.  This may be interpreted as the
total charge, the charge per unit length, or the current---whichever
is appropriate.  The fourth number, if present, is the radius of an
extended cylindrical or spherical source.  There are a few ``oddball''
sources available but not listed that don't conform to this scheme,
but only one is ever used in these modules.  Sources are drawn
onscreen as specified in tables \ref{esources} and~\ref{msources}
unless the applet parameter \texttt{showsources}
(figure~\ref{applet_html_text}, line 10) is set to \texttt{false}.  A
source will not appear if it is located outside the applet's screen
area.  It is still being ``drawn'', though, but outside the applet
space, and still has an associated field.

Sources use a red/blue color scheme to indicate polarity; red
indicates ``positive'' for static electric charges and ``out of the
page'' for currents and Faraday solenoids, and blue represents
``negative'' or ``into the page''.  A Faraday solenoid is dark red
(maroon) if its magnetic flux is increasing out of the page, and dark
blue otherwise.

\begin{table}[htbp]
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
\textbf{Source type}&\textbf{Description}&\textbf{Drawn as}\\\hline
\texttt{PointCharge}  & Point charge & Ball image\\
\texttt{SphereCharge} & Uniformly charged sphere & Circle\\
\texttt{ShellCharge}  & Uniformly charged spherical shell & Circle\\
\texttt{LineCharge}   & Infinite uniform line of charge & $+$ or $-$\\
\texttt{CylinderCharge} & Infinite uniformly charged cylinder & Circle\\
\texttt{FaradaySolenoid} & Solenoid with time-varying field & Dark Circle\\
\hline
\end{tabular}
\end{center}
\caption{Sources of electric field}
\label{esources}
\end{table}

\begin{table}[htbp]
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
\textbf{Source type}&\textbf{Description}&\textbf{Drawn as}\\\hline
\texttt{ThinWire}  & Infinite, zero-width current & $\odot$ or $\otimes$\\
\texttt{FatWire} & Non-zero-width current & Circle\\
\texttt{DisplacementCurrent} & Capacitor with time-varying field
& Light Circle\\
\hline
\end{tabular}
\end{center}
\caption{Sources of magnetic field}
\label{msources}
\end{table}

% There's a bad page break in the arctan line, which leads to a bad
% page break in a footnote later.  Remove the \enlargethispage if any
% rewriting makes it irrelevant.
%\enlargethispage{\baselineskip}

Whenever the mouse pointer is moved, the applet prints the pointer's
location in the status line of the browser.  This position, like the
positions of sources, is measured in pixels from the upper left
corner.  Many of the questions in the exercises ask for the location
of some feature such as a source or a place where the field vanishes.
There is no way (or need) to disable this behavior.

The electric and magnetic field explorers have a common visual
behavior because they are both derived from a common parent.  As the
student moves the mouse pointer around, the applet draws an arrow
based at the pointer's location; the arrow points in the direction of
the field and its length is indicative of the field's strength.  The
length is not proportional to the field's strength, but it is at least
a monotonic function of the strength.  (See
figure~\ref{arrow_divmeter}.)  The infinitely-long sources have fields
whose strengths decrease with distance as $1/r$, and the arrow behaves
well if its length is proportional to $\arctan\sqrt{f}$, where $f$ is
the field strength.  When all the sources are point charges, and the
field contributions decrease as $1/r^2$, the arrow's length should be
proportional to $\arctan\sqrt[4]{f}$.

\graphicp{effis1.gif}{Field arrows and divergence
meters.  The applet contains infinite lines of charge and
uniformly-charged infinite cylinders.}{arrow_divmeter}

\graphicp{eflines1.gif}{Electric field lines. The charge distribution
is as in figure~\ref{arrow_divmeter}.  The hue of a
point on a field line indicates the strength of the electric field
there.}{efield_lines}

The student can explore field properties by pressing the mouse
buttons, perhaps simultaneously with the keyboard modifier keys
(Shift, Control, Alt, and Meta) and by pressing some of the keyboard
letter keys.  The field applets are capable of using every possible
mouse button/modifier combination, but fortunately for the student, no
assignment has more than a few related combinations enabled.  In
addition, a help page lists and explains all of the combinations.
Most of the applets' capabilities can be enabled and disabled with
parameters in the HTML code.  In this way, an applet can be customized
so that the students cannot accidentally do anything that they are
not yet ready to understand.

When the student presses and holds the proper combination of mouse
buttons and modifier keys (Control-Right), the field arrow is replaced
by a ``curlmeter'' which measures and prints the curl of the
field\footnote{Different machines have mice with different numbers of
buttons.  A Macintosh mouse has one button, a PC mouse has two, and a
Unix workstation mouse has three.  Java handles this problem by
pretending that every mouse has just one single button; for two- and
three-button mice, it's the left button.  Java interprets the right
button, if any, as the single button plus the Meta key (Macintosh:
Command key), and the middle button, if any, as the single button plus
the Alt key (Macintosh: Option key).  This allows an underequipped
student to simulate a three-button mouse.  By judiciously combining
modifier keys and mouse buttons, the student can make the applet think
he has simultaneously pressed both the right and middle buttons.  In
this case, the applet will then perform both actions.  In this paper,
I will assume a three-button mouse and refer to the left, middle, and
right buttons.  In a description of a button combination, the
capitalized word ``Left'' means ``the left button'' and similarly.}.
Releasing the button changes the indicator back to the arrow.  In
every case, the curl vector is either zero or is directed into or out
of the applet plane.  The curl is therefore described by a scalar
which is positive for curl directed out of the page and negative for
curl directed into the page.  The curlmeter looks like this:
\iftechexplorer\includegraphics{curlmeter1.gif}\else
\raisebox{-4pt}{\includegraphics[scale=0.25, clip, bbllx=315,
bblly=160, bburx=385, bbury=230]{curlmeter.ps}}\fi\ and represents
four identical positive charges at the ends of a cross connected to a
torsion spring.  One arm of the cross is its pointer and is thicker
than the other arms and also colored red.  The greater the field's
curl, the more the curlmeter is deflected from its unrotated position.
The amount of deflection is a logarithmic function of the curl,
suitably constrained, so that when the curl is zero the curlmeter
points to twelve o'clock, and when the curl is large the curlmeter is
``pinned'' at six o'clock.  The direction of the deflection is
clockwise for negative curl and counterclockwise for positive curl.
The illustration (eleven o'clock) thus corresponds to a small positive
curl.  Use of the curlmeter is not allowed if the applet parameter
\texttt{curlmeter} (figure~\ref{applet_html_text}, line 13) is set to
\texttt{false}.

There is also a divergence meter (Shift-Right), which looks like a
black square with the word ``\textsf{div}'' in it.  The divergence
meter's sides bow inward and change color towards cyan for negative
divergence and bow outward and redden for positive divergence:
\iftechexplorer\includegraphics{divmeter1.gif}\else
\raisebox{-4pt}{\includegraphics[scale=0.25, clip, 
bbllx=315, bblly=160, bburx=385, bbury=230]{divmeter.ps}}\fi.  (See
figure~\ref{arrow_divmeter}.)  The divergence meter is disabled if the
parameter \texttt{divmeter} (figure~\ref{applet_html_text}, line 14) is
set to \texttt{false}.

The indicators (field arrow, curlmeter, divergence meter) can be
``dropped'' to remain at a point by substituting the middle button for
the right button.  A field arrow is dropped with Shift-Control-Middle;
for consistency, then, the combination Shift-Control-Right performs
the useless action of ``changing'' the indicator from a field arrow to
a field arrow.  It is also possible to drop an array of indicators on
a lattice covering the whole applet.  The array-dropping actions are
triggered by keyboard keys (\texttt{A}, \texttt{C}, and \texttt{D}
respectively) rather than mouse buttons because the location of the
mouse pointer is irrelevant.  The collection of indicators, as well as
anything else drawn on the screen, is erased with \texttt{E}, backspace,
or delete.

A Right mouse click with no Shift or Control draws the field line
through the mouse pointer's location.  Field lines are drawn with a
rainbow of colors to indicate the field strength along the line.  Red
represents a strong field; yellow, green, and cyan represent
progressively weaker fields, and the weakest fields are colored blue.
(See figure~\ref{efield_lines}.)  The color-choosing algorithm is
similar to the one that determines the length of the field arrow.  The
student can then move the pointer along the field line and see that
the field arrow is always tangent to the field line.  The applet
calculates a field line by using a Runge-Kutta method to take short
steps along the direction of the field.  The step size of 0.3 pixel is
large enough to allow the calculation to finish in a reasonably short
time, but small enough not to accumulate inaccuracy.  The calculation
terminates when the line reaches a point on the applet boundary, a
point where the field is zero, or a point within one pixel of its
starting point.  Field lines will not be drawn if the applet parameter
\texttt{fieldlines} (figure~\ref{applet_html_text}, line 15) is set to
\texttt{false}.

The applet calculates equipotential lines (Middle click) in a similar
way.  The equipotentials, when defined, are the integral curves of the
``potential stream function'', which is always orthogonal to the
electric field.  The applet finds some multiple of the stream function
by rotating the field by $90^\circ$; the magnitude may not be correct,
but it is not relevant, because only the direction matters.  The
equipotentials are drawn in cyan, as shown in
figure~\ref{equipotential_lines}.  Equipotentials will not be drawn if
the applet parameter \texttt{equipotentials}
(figure~\ref{applet_html_text}, line 16) is set to \texttt{false} or
if the field does not admit a scalar potential.

\graphicp{efeqps1.gif}{Equipotential lines for the same charge
distribution as in figures \ref{arrow_divmeter} and
\ref{efield_lines}.}{equipotential_lines}

\graphicp{effr1.gif}{Circulation of the electric field (Faraday's
Law).}{faraday_loop}

\graphicp{efgc1.gif}{Flux of the electric field (Gauss's
Law).}{gauss_surface}

\graphicp{ampere2.gif}{Circulation of the magnetic field (Ampere's
Law).  Here the sources are thin and thick wires.}{ampere_loop}

The applet can also illustrate Maxwell's laws in integral form for a
two-dimensional source.  By clicking and dragging the left mouse
button, the student can create a circle (Control key) or a rectangle
(no Control key) which will be either a closed loop (no Shift key) or
the ``footprint'' of a closed surface whose height is one unit (Shift
key).  So, Control-Shift-Left drag creates a circular surface.
Mnemonically, \textit{S}hift is for \textit{s}urface and
\textit{C}ontrol is for \textit{c}ircle.  If the student has chosen a
loop, the applet will then calculate the contour integral of the field
counterclockwise around the loop, and if the student has chosen a
surface, the applet will calculate the two-dimensional analog of the
surface integral of the field through the loop.  In both cases the
integral is calculated using Simpson's rule with a step size of half a
pixel.  The applet then displays the resulting circulation or flux
with an appropriate integral sign and equation in the upper left
corner.  See figures \ref{faraday_loop}, \ref{gauss_surface},
and~\ref{ampere_loop}.  Loops and surfaces are enabled or disabled
with the \texttt{loops} and \texttt{surfaces} parameters.  (See
figure~\ref{applet_html_text}, lines 11 and 12.)

\section{Class Use}

The web pages developed by Project Links\cite{links_cip} at Rensselaer
are organized into ``modules''; a module contains several pages about
a single topic, and represents about one class's worth of
instructional material.  Many of the pages contain applets in addition
to explanatory text and questions to guide the student.  The
Electricity and Magnetism modules roughly correspond in scope, but
certainly not in depth, to the chapters of a textbook.

\subsection{Electric Field Module}

I will use the Electric Field module as an illustration of the use of
the field applets.  The applets are used for both simple examples and
complicated exercises.

\subsubsection{Examples}

After the students have had a mini-lecture and some discussion of
electric field, they work through a Web page of examples.  This
features a series of field applets with simple charge configurations.
These examples should help the student realize that

\begin{itemize}
\item The electric field generally becomes weaker as the distance from
the sources increases.
\item Electric field lines terminate at charges or go off to infinity.
\item In symmetrical situations, there are points where the field's
direction is particularly easy to determine.
\end{itemize}

The examples begin with single charges (figure~\ref{tour_ef_ex1}).
The student should observe that the field and the field lines are
radial.  Other simple examples have two or four point charges.

\subsubsection{Hidden Charges Exercise}

Once the students are familiar with the behavior of the electric
field, they are asked to perform an in-class exercise on finding
hidden charges.  The students work in groups of about four, and they
are asked to find the location, sign, and (qualitatively) relative
magnitudes of some invisible point charges in the applet space.  Here
the applet parameters \texttt{showsources} and \texttt{fieldlines} are
set to \texttt{false}; allowing visible field lines would make it much
too easy to find the charges.  It is still possible to drop field
arrows.

The students are asked to hand in answers to the following questions: 
\begin{enumerate}
\item How many charges are in the rectangular area? (\textsl{Two.})
\item Give the coordinates and sign of each charge. (\textsl{Both positive.})
\item At how many points in the area is the electric field equal to
zero? (\textsl{One.  Look for the smallest arrows.})
\item Give the coordinates of those points where $\mathbf{E} = 0$. 
\item Rank the charges according to their charges, most positive
first. (The location of the points where $\mathbf{E} = 0$ should help
here.)  (\textsl{The charge in the lower right has the largest magnitude.})
\end{enumerate}

These questions direct the students' attention to specific features of
the field and guide them to discover properties such as the principle
of superposition.

\graphicp{tour_ef_ex1.gif}{Single positive charge.}{tour_ef_ex1}

\graphicp{tour_ef_hc1.gif}{Hidden charges
exposed.}{hidden_charge_applet}

\subsection{Other Modules}

The field applets also appear in modules on electric potential,
Gauss's Law, Faraday's Law, magnetic fields, Ampere's Law, and
Maxwell's Equations.  In every case, the applets are configured
appropriately for the subject matter; for example, in the Gauss's Law
module, some of the sources are uniformly charged cylinders, and the
students can use the divergence meter and draw (two-dimensional)
Gaussian surfaces, and in the Faraday's Law module, the sources are
solenoids with linearly-time-varying magnetic flux, and the students
can use the curlmeter and draw loops.

Other electromagnetism modules contain applets that model capacitors
and resistors, graph the voltages in \textsl{LRC} circuits, and
illustrate some principles of optics.  The modules are available at
\iftechexplorer\else\\\fi{}
\url{http://links.math.rpi.edu/devmodules/electromagnetism/}.

\section*{Acknowledgements}

This work is part of Project Links
(\url{http://links.math.rpi.edu/}) and has been supported in part by
National Science Foundation grant \#DUE--9552465.

\pagebreak

\iftechexplorer
\section*{References}
\fi

\begin{thebibliography}{99}

\bibitem{wilson_studio} Jack M. Wilson, ``The CUPLE Physics Studio'',
\textsl{Physics Teacher} \textbf{32}, 518--523 (1994).

\bibitem{novak_patterson} Gregor M. Novak and Evelyn T. Patterson,
``World Wide Web Technology As a New Teaching And Learning
Environment'', \textsl{International Journal of Modern Physics C}
\textbf{8}, 19-39 (1997).

\bibitem{networked_physics} G. D. Bothun and S. D. Kevan, ``Networked
Physics in Undergraduate Instruction'', \textsl{Computers in Physics}
\textbf{10}, 318--324 (1996).

\bibitem{w3c_mml} The World-Wide Web Consortium has issued a
recommendation on an HTML extension called MathML.  See
\url{http://www.w3.org/Math/} (current on April 2, 1999).

\bibitem{webeq} WebEQ from Geometry Technologies, Inc.\ is available
at\iftechexplorer\else\\\fi{}
\url{http://www.webeq.com/} (current on April 2, 1999).

\bibitem{techexplorer} The IBM techexplorer website
is\iftechexplorer\else\\\fi{}
\url{http://www.software.ibm.com/techexplorer} (current on April 2, 1999).

\bibitem{java} Among the many good references about the Java language
are \textsl{Java in a Nutshell} by David Flanagan (Cambridge, MA:
O'Reilly and Associates, 1997) and Sun's Java web site at
\url{http://java.sun.com}.

\bibitem{christian} Wolfgang Christian, ``Physlets: Java Programming
for Physics Educa\-tion'', \textsl{AAPT Announcer} \textbf{27}, 90
(1997).  Contributed talk to the AAPT Summer 1997 Meeting.  The online
version is at\iftechexplorer\else\\\fi{}
\url{http://WebPhysics.Davidson.Edu/WebTalks/JavaTalk/Welcome.htm}%
\iftechexplorer\else\\\fi{} (current on April 2, 1999).

\bibitem{links_cip} William E. Boyce, John B. Brunski, Michael
M. Chen, Kevin Craig, James A. Fairweather, Joseph W. Haus, Joseph
Porter, and William L. Siegmann, ``Interactive Multimedia Modules in
Mathematics, Engineering, and Science'', \textsl{Computers in Physics}
\textbf{11}, 151--156 (1997).  An introduction to
\docLink{http://links.math.rpi.edu/}{Project Links}.

\end{thebibliography}

\end{document}
