Designing the Mathematics of
The Mechanical Universe

James F. Blinn

May 17, 1995

1. INTRODUCTION

The Mechanical Universe is a 52 episode telecourse funded by the Annenberg Foundation to teach introductory college level physics. Each half hour program contains five to ten minutes of computer animation illustrating concepts from basic mechanics to relativity and quantum physics. In this article I will describe the design aspects of the mathematical portions of The Mechanical Universe project.

A question of interest to someone with a primarily technical background is: How much of design is just functionless decoration and how much of it is really necessary for making images easier to interpret? Some decoration really does help the viewer to understand an image. Other decoration just makes an image look interesting and draws the viewer into the subject matter. But too much decoration can be distracting and obscure the meaning of the data.

It is possible to come up with a few rules or guidelines to use in designing the images, but it's hard to remember to apply the rules all the time. It's not like programming. The concept of "works" or "doesn't work" is not so distinct. A computer program that doesn't work usually just stops dead and does nothing. A design that doesn't work just sits there and glares at you. The image always exists, it just might be confusing. There is more of a continuum of correctness in design.

2. WHAT IS A DESIGN PROBLEM?

Let us begin with the question "what is a design problem?" Design can be likened to pantomime. You are required to present some information that, perhaps, could be described in words, but you are allowed to use only pictures. Here are some simple examples.

  1. The Voyager spacecraft approaches a planet. A moon is off to the side. You must pan across to see the moon but still give the viewer some idea of context of where he is now looking compared with where he was looking before.
  2. You are illustrating the magnetic field of Uranus. The field is offset from the center by .3 times the radius of the planet. You want to show how this makes the field at the surface have different strengths at the North and South magnetic poles. But close up you can't perceive the shape of the dipole field and its rotational motion, it's just a tangle of lines. You have to move in and out to show details vs. global structure.
  3. You wish to illustrate the concept of a vector. The idea is to list the various types of vector expressions and to give an idea of whether the result is a vector or scalar. New items are added to the list as the program proceeds. The whole list may not fit entirely on the screen. In addition, as a new item is added, some geometric demonstration is needed to show what it is.

Let's look at a solution to this last problem in some detail.

One goal is to differentiate clearly between Vectors and Scalars. We represented an abstract "space"' where the vectors live as a kind of vector-land. There is a river running down the middle separating it from scalar-land. Vector expressions are on one side of the river and scalar expressions on the other.

A second goal is to portray large lists without confusing the viewer with excessive text. Our solution was to display the lists in perspective, receding into the distance. As each new object is introduced we add it to the front of the list and make the rest of the list recede further into the distance. Old list items may no longer be legible, but the memory of them is enough to remind the viewer of what they are.

Now we must give an impression of 3D space but still make it look somewhat abstract. An oblique view of the ground plane must appear to recede into the distance. This can be shown by texture; an obvious texture is a grid. This shows perspective very well, however at this point in the academic development, the notion of a coordinate system has not yet been presented. Some other textural effect must be used. Texture mapping a random, say, pebbly texture would be computationally slow (a practical production problem). Our solution was to place a randomly scattered group of lines, looking like grass, across the plane. Just a few such lines can give a very cheap impression of receding ground plane. Also the color of the plane is made to get bluer and paler as it moves into the distance. This is a common artistic, illustrator's trick. Drop-shadows help to bring out the 3 dimensional quality and make the vectors seem to hover above the plane, giving an interesting surreal effect.

Later in the program unit vectors and coordinates are introduced. (When we introduce unit vectors i and j they tip their hats.) Now a coordinate grid is placed on the plane (but only a small piece of it). Grids are a bit overused in computer graphics but we actually have a valid reason for using them in MU since we are actually plotting graphs.

3. DESIGN PRINCIPLES

I'll now list a few design principles that became apparent in the MU design process. I haven't learned design by any formal training. It has come by practice, intuition and perhaps genetics (I come from a family of artists). I learned to solve design problems by being presented with them, by being forced to think about the implications of color and shape choices. The results are what made sense to me at the time.

3.1 Direction of Attention

It is important to direct the attention of the viewer to the important parts of the picture. These scenes will be seen on TV in fairly brief bursts, so the important parts must stand out. One good trick for doing this is to look away from the screen and look back quickly; determine what you see first when looking back. Is that the important part of the picture? If not, change the picture to make it so. This means avoiding gaudy backgrounds; the background should not look more interesting than the foreground. In one example I had an equation over a dark blue background that graded into orange, giving a sort of sunset effect. It was very pretty, but the problem was that when you first look at the screen all you saw was the orange. I changed the background to a more neutral color and the first thing you now see is the equation.

3.2 Avoiding Information Overload

I have consciously avoided trying to "dazzle" the viewer. Dazzling implies an overload or numbing of the senses. The whole idea of the MU project is to communicate, draw the viewer in, instead of making him tip backwards off his chair.

For the same reason I don't use lots of spinning or tumbling of 3D objects, it seems distracting to me. There is a tradeoff here between not giving viewers enough views of an object to be able to understand its three-dimensional shape vs. making it confusing by spinning it around too fast.

One important trick to encourage simplicity in design is to design the scenes while viewing a monitor from across the room. If an image can be made legible at a distance of 10 feet it's about right. This discourages putting in too much small detail.

3.3 Video Restrictions

You can't be subtle in video. You can't get a lot of detail into a video image. Lines must be pretty thick; vertical and horizontal lines can come out different colors if you make them even as thin as the video bandwidth allows. Red comes out especially blurry. You can't have abrupt color changes, especially of complementary colors, (like green to magenta) across a scan line. I regard this as an advantage, especially in designing moving things. It keeps pictures from getting too busy, although some of the scenes in MU are, even so, too cluttered.

Note that the slides shown during this talk were made at video resolution. Again, it forced me not to put too much on one slide. Many slides shown in talks have lots of microscopic detail that simply isn't legible. Viewing slides in an auditorium has about the same visual detail as video.

Don't design on a high resolution system then transfer the images to video. You'll just fool yourself into thinking that some things will work, but they will turn to a blur on the transfer.

3.4 Color Selection

Given the color television medium we have both the opportunity to make scenes in color and the responsibility to make the colors look good. There are a few common tricks to use in color selection. I find I have favorite colors, I tend to lean towards blues and greens. I don't like purple, although I once used it purposely to break out of my rut. It was used as a background in a scene on conic sections. This raised other problems since I originally wanted to put a red cone in front of it but I couldn't get a red that didn't disappear into the purple in dark areas (as seen in b/w). Finally, I went to a brighter yellow cone.

3.4.1 Make it work in Black and White

When designing, look at the picture with the color turned off and see if it "reads" (to use a designer term). "Reads" in this context means "can you tell what is going on; do the appropriate things stand out". While color is important in the MU animations it is not the only thing that differentiates items on the screen. It's not crucial. I have made consistent color decisions but the viewer is not expected to remember color schemes to understand a scene.

3.4.2 Context

There is a commonly known psychophysical effect that a given color will look entirely different against differently colored backgrounds. For this reason, color palette selection programs are not too useful. The only real way to see how a given color choice works is to see it in the context of the final image.

3.4.3 Distance Cues

One of the most common artistic depth cues (mentioned already) is to make objects get bluer and paler with distance. Another distance cue is to make things disappear into a fog (an exponential decay of contrast with distance). This was done literally in a scene of the molecular arrangement of a salt crystal.

Vector field lines are a complex set of three dimensional curves that are a good test of depth enhancement techniques. They can look like a pile of spaghetti if you're not careful. The distance interpretation was aided by three techniques. One, normal depth cueing; Things get darker with distance. Two, drawing them in depth order so a closer (brighter) line will overlay a farther line. Three, making the intensity of the line darker at the edges than in the middle. This gives a slight "cylindrical" solid quality to the lines.

3.4.4 Consistency

Make consistent usage of color schemes to recall previous results, as well as to differentiate different things. We will discuss the color scheme extensively below.

3.4.5 Not too many

Don't use too many colors, it tends to look gaudy and jarring. There is also a problem with running out of colors. There are more physical quantities to represent than there are easily distinguishable colors. You can't use saturation or value to distinguish things because sometimes these need to be adjusted depending on context.

3.5 2D/3D Considerations

Two dimensional diagrams are easier to interpret than three dimensional diagrams, especially when they are in motion. The main reason, of course, is that you cannot see all parts of a 3D shape on any given 2D view of it. Another more subtle problem is that labels and annotations keep getting in the way of each other if a 3D diagrams is rotated.

Since most of the physics of the first term of MU consisted of essentially two dimensional problems (for example Keplerian orbits) they were kept 2D. Some inherently 3D concepts (like torque and angular momentum) had to be in 3D. In the second term were more inherently 3D problems. You must use 3D for electromagnetic fields. Many textbooks try to get away with 2D for fields but much is lost.

In fact, there were some 3D situations that were simplified to 2D. For example, I used 2D for the Lennard-Jones atomic motion simulation and the ideal gas simulation. The actual physics is 3D, of course, but 2D shows the phenomena adequately and 3D would be really confusing.

Also, 3D was used in our first vectorland example as a trick to put more text on screen. As the screen tilts back, more text fits. The top row might not be legible anymore, but we can remember what it was.

The punch line is, use 3D only when absolutely needed.

3.6 Making things stand out from background

Drop shadows help make things stand out from background. While they are good for labels on graphs, don't put a drop shadow on the plotted graph line because it detaches it from the grid.

Several scenes that dealt with abstract 3D concepts such as vectors used 3D shadows even though there was no ``real'' object and no ``real'' light source involved. This helps to see 3D shape by simultaneously giving two views of the object, a 3D view and a projection of that view on the ground plane. This is sort of what the art movement called Cubism attempted to do, show many views of an object at once. The shadow technique however is more familiar since it is the way we are used to seeing and interpreting real 3D things.

In general you should make backgrounds paler and have less contrast than foreground object.

3.7 Character Sets

I used a public domain character set called the Hershey character set for all animated text. At first at the suggestion of the vieo production people, I used a sans-serif type font for all equations. It always looked strange to me though. It was not until I finally looked closely at some math books that I realized that there are typographical conventions in mathematics that had never floated to my conscious mind before. Scalars are in italics, vectors are boldface. When I did this on the screen the equations began to look like mathematics. Two or three of the first programs we did still have the old typeface but I went back and redid the animation for program 2 to use correct character sets.

In fact, even for scenes where an equation is just superimposed over live action, and not animated, I generated the equations with our animation system. This was because normal video production character font generators simply can't make math look right.

A general principle of character design has been elucidated by Edward Tufte: To ease reading, a type font should make the letters look as different from each other as possible. Note that in Gothic or Helvetica type fonts the letters do not have as much variation as with Times Roman or similar fonts.

3.8 Realism vs. Abstraction

Images representing some real, physical object are often overlaid with labels, vectors etc. For such scenes, the real object is rendered with a simulated light source and shading (usually with a simple polygon rendering program). The mathematical abstractions are overlaid with a line drawing program (lines don't change thickness as they get closer or farther from viewer).

3.9 How it's REALLY Done

A designer does not necessarily consciously go through a list of design rules when constructing an image. In fact, for the most part, I just LOOK at the picture as it develops and ask myself

What don't I like about this picture? Hmm, this part disappears into the background; that part is too subtle.

Lots of design rules are, in fact, made up after the fact. This is true in many other disciplines also. Like the rules of music composition. Most composers just wrote down what sounded interesting to them, leaving it to the music historians to figure out what the patterns were.

4. DESIGN ELEMENTS

4.1 Color

A normal textbook diagram has shapes, lines, text. In video we have, in addition, color and motion. The challenge is how to use them. Where there was some previous convention for color assignment I tried to use it. Where there was none, I had to invent one.

Many different ideas were keyed to colors with the following considerations. First, not everyone has a color television set. So the colors were chosen so that, in black and white, they would still have enough difference in brightness to be distinguishable. Since the animations never relied solely on the color to be understandable much of effect of the color coding was rather subliminal. I was left with the impression, however, that there simply aren't enough colors to have a unique one for everything. Anyway, here follows some examples of color usage.

4.1.1 Dimensional Analysis

When physical abstractions such as acceleration or torque are represented in vector diagrams or algebraic labels they must be some color. Rather than just making all vectors and labels white I chose to institute a color scheme that is keyed to the units the quantity is measured in. These color schemes are maintained throughout the series. This provides for a sense of continuity and also gives the viewer a key for dimensional analysis.

Also, I tried to avoid the temptation to get overly cute with the colors. Colors are used primarily for labels. Terms in equations are usually white, otherwise the equation tends to look like confetti. A term is shown in color only if the dimensions are important for a particular derivation.

Position, velocity and acceleration are the most commonly used quantities in basic mechanics. The color scheme used was:

The exact hues chosen were not the pure television primary colors, but slightly off the primaries and were selected visually to look nice together. Exact primary colors tend to look boring.

There are several motivations for this general color scheme. As successive derivatives are taken, the color shows a smooth progression along the color wheel from green to red so there is a visual progression between the colors. (Actually, the reddening applies not so much to derivatives as to the division by time).

Green is the color of grass and vegetation. It gives a static "place-like" effect.

Red is the most "active" of the three colors and applies to the most "active" of the three concepts, acceleration. Red means "stop", a deceleration or negative acceleration. Red is also the most exciting, attention-getting color. It shows that something is going on, and thus looks dynamic.

This color scheme also worked well when applied to a scene showing elevation and slope by using an abstract bicycle rider. The normal color for informational traffic signs (green) was used to label the elevation. The normal color for warning traffic signs (yellow) then labeled the slope.

4.1.2 Colors of Areas

Integrals are sometimes shown as areas under the curve of a function. Here the function is plotted against a dark yellow or red background. The area filled in under the curve is colored the appropriate "derivative color", i.e., green under a yellow curve, yellow under a red curve.

4.1.3 Torque and Angular Momentum

Angular momentum is a rotational concept. I toyed with the idea of giving Angular momentum vectors a sort of barber-pole effect but it seemed too busy. Angular momentum is also mass times velocity times distance. Maybe a sort of pale yellowish green? But that would not make it distinguishable enough from the other two colors. Finally I decided to take off in a new direction and make it a pale blue, primarily to make it visually different from any of the above colors.

Torque, the derivative of angular momentum, is, of course, lavender: blue with red added to it.

4.1.4 Area and volume

These were made variants on the green color. Area is a slightly bluer shade. Volume is a still bluer shade. Maybe I was getting too subtle here, but you have to pick some color, and it might as well be for some reason.

Actually this choice was not made consciously and explicitly early in the design process. As a result, the color for area is not exactly consistent over the whole series. For example, the color of Gaussian surfaces in the electricity programs was the position color, not the area color. This led to some problems when showing surface integrals. You do your best, but sometimes mistakes creep in.

4.2 Scientific Accuracy

One might think that absolute scientific accuracy is required for all scientific simulations. Since this is Computer Animation the viewer expects precision and accuracy.

Some things were done geometrically correctly, even though it was difficult. For example, the radii of the orbits of the Bohr atom are proportional to the perfect squares (1, 4, 9, 16, ... ). In order to see as many as four orbits, the scale must be too small to make the first orbit clear. This was usually solved by having the camera pull back when discussing the larger and larger orbits. This is a useful general principle; if there is a large range of sizes, moving the view in and out can show all parts legibly.

The sizes and timings of many physical phenomena sometimes simply have too large a range to make this easy and they must be distorted into schematic diagrams to be able to represent the desired range of phenomena. It is important to give some visual cues to show when this is being done. One way to do this is to have the schematic scenes drawn with sketchy or irregular lines. This removes the precision effect of perfect lines. For example, when force laws are introduced we needed to show the operation of gravitational and electric forces. At this point, the magnitudes weren't important, only the signs. Crude schematic faces were used as mass particles (grey faces) and as positive and negative charges (red and cyan faces). The motion was sketchy, only showing attraction vs./ repulsion, and the faces were sketchy, with irregular and comical lines. This visual signaling was not done enough in the series.

Other scenes with schematized motion included:

4.3 Motion

Former Disney animators Frank Thomas and Ollie Johnston have written a book called The Illusion of Life detailing their experiences at the studio. From reading their book you are left with the impression that animation is the highest form of human art. It encompasses all aspects of static art and adds timing and motion too. Motion design may well be the next great research topic in computer graphics. My comments here are very preliminary.

4.3.1 Speed and Timing

Timing refers to how many frames it takes for a particular motion to occur. My animation system allows for any floating point frame number to be used as a keyframe, with interpolation between. But in the earlier programs I tended to use 10 frame time slots for a particular motion. This was simply because the frame numbers were printed out on the screen and they looked prettier if they were in units of 10 frames. Ten frames is about 1/3 second and on retrospect it seemed to produce pretty fast, jerky motion. In later programs I began using 20 frame motions. It still makes things a bit predictably clocklike but this is not all bad. The music composer for the series mentioned that all the animations seemed to have a rhythm to them.

Part of the problem with not being more creative with timing is that the previewing program usually ran about 6 frame updates per second (skipping over enough frames each time to make the global timing approximate real time). You could see the general sense of the motion but couldn't appreciate the subtleties of timing so well.

4.3.2 Interpolation

It is the popular wisdom in animation that spline interpolation is better than linear interpolation. It is smoother. Most of the animations were done with splined motion. However, later in the series I began experimenting with linear interpolation and found it quite pleasing. Let's face it, the algebraic motions represent mechanical operations, so why not make them mechanical looking? In this case non-natural (jerky) motion sometimes looks more interesting than smooth motion because it's (1) different and (2) contains more high frequencies at the key frames.

4.3.3 Motion enhancement

There are various "classic" techniques found in conventional animation that apply here.

Squash and stretch refer to a distortion applied to the shape of an object when it undergoes acceleration. This is easily done by animating the x and y scale factor of an object. Before it begins to move it gathers itself up by shrinking in x, then it stretches out in x as it is moving, and when it stops it shrinks briefly and returns to its normal size. This wasn't done in MU as much as it should have been.

Overlapped motion is a technique where motion 2 starts before motion 1 is completed. This works well with character animation but I found it of limited usefulness in algebraic animation. In algebra there is just too much to follow without having the individual steps of a derivation merge into each other. Making the steps disjoint in time gives the viewer a chance to absorb one step before another begins. I did make the x and y motion of an object overlap, but this just rounds off the corners of the motion.

4.3.4 Perceptions of speed

I found it interesting to discover how limited our perception of velocity is. Given two successive scenes, where an object moves, say, 1.5 times as fast in the second scene, it is very hard to tell which is which. Since were showing velocity changes in a lot of the physics, this was a problem. Most of the solutions involved representing velocity spatially as well as temporally by adding streaks or velocity vectors to moving objects.

Another interesting speed-perception discovery concerns double framing. One would think that all animation is ideally single framed. Double framing is just a cheapo economy measure if you don't have the computer time to do all the frames. Double framing looks jerkier. But there's another perceptual effect of double framing. Double framed motion looks faster than single framed motion. That is, if an object moves across the screen in 1 second, it will look like it is moving faster if it is animated as 15 frames double framed, than 30 frames single framed. This was alluded to in Thomas and Johnson's book on Disney animation. They said that motion was sometimes purposely double framed to give it a `jaunty' look.

4.3.5 Character Animation

The highest form of animation is perhaps character animation. In it you try to convey thoughts and emotions with just two dimensional shapes. We had some need of character animation for MU but the system is not really designed for fluid inbetweening Disney style drawings.

Instead I adopted a style that goes back to my High School days. A friend of mine and I made some simple character animation with paper cutouts and hinged joints. The 2D shapes of the components were fixed, they could just rotate about joints. This technique is easy to simulate with our software system and comes off reasonably well on the screen. Characters don't continuously turn from left to right; they do it in just one frame. Knees don't bend during walk cycles. The feet of an animated soldier just scissor back and forth. The feet of the Greeks were made like a pinwheel; four feet radiating from a center of rotation. Just the bottom two stick out from the bottom of the toga. Then just rotating the feet-object makes the walk cycle. This is not the fluid Disney style but it has its own primitive charm.

4.4 Summary

Design is not just random decoration. It should serve a concrete purpose, that of making the images more intelligible to the viewer. Generally, scientists do not spend nearly enough time thinking about the communicative effects of their design (color, shape, texture) choices. However, with more availability of color computer displays everyone at least has the tools to experiment with. With a little thought applied to these tools some very effective communication can result.

5. VISUAL METAPHORS

Here are some more visual metaphors, this time grouped by subject matter, rather than by design issues.

5.1 Algebraic Ballet

To make the science respectable we had a lot of algebra to present. Algebra, however, can be a bit draggy. We decided to liven it up by animating the algebraic transformations the equations go through. These animations usually go by fairly fast, in fact it is not likely the viewer will be able to follow all the steps upon first viewing. The speed was a concern, but we felt that making it slower would slow down the programs too much. The idea is to get the feel for what is going on and be able to look at a videotape slower to get the detail later if desired.

Transforming algebraic operation into motion proved to be an interesting exercise. Many of the motions seemed pretty obvious to me, but they will be listed here for completeness.

5.1.1 Term labeling

It's easy to lose track of what different symbols in an equation represent. This was addresses by having the symbols identify themselves with English words popping out and shrinking back into them.

5.1.2 Balancing Act

Simple algebraic operations to move terms around were animated literally.

5.1.3 Canceling

This applies to the removal of identities like a-a or a/a. Some ways used to depict this were:

5.1.4 Recalling old results

5.1.5 Substitution

Substitution involves taking an equation defining some variable and replacing occurrences of that variable into another equation. Some examples:

5.1.6 Varying parameters

Some representation of inversely varying parameters was done by showing the equation

AB=constant

and having the letters for A and B scale up and down in opposite phase with each other.

5.1.7 Visual Puns

The program on wave motion shows some approximate relations between wave speed and various physical parameters. The sign ripples like a propagating sine wave while these equations appear. This was done by modeling the lines of the sign with a one-cycle helix. Rotating it about x and then scaling by 0 in z made it ripple.

5.2 Calculus

A few algebraic operations on calculus notation

5.2.1 Limits

Used an explosion to express the limiting process when turns into d. The explosion was generated by a simple 2D pattern scaled up and faded out simultaneously.

5.2.2 Symbolic derivative machine

Since we evaluate derivatives and integrals symbolically many times in the series, we developed a quick way to do it…the derivative machine.

Design -- The derivative machine is an expression transformer, it has two functions differentiation and integration. An expression goes in one end and comes out the other end. so it needed to be thin in the x direction so there would be plenty of room on each side to show the inputs/outputs. When the DM is first introduced, it comes in a crate marked "ACME Derivative Machine" (a hat tip to the old Chuck Jones Roadrunner movies). A crowbar shaped like an integral sign opens the crate. Some random wheels and lights made it look Rube Goldberg-ish. The sides are not exactly straight and the wheels are not exactly round.

When the DM is introduced, in program 3, the internals are shown two ways.

As various elementary operations are introduced they shrink down into a sort of circuit board that is plugged into the machine, the door slams, and a new light blinks on on the front panel.

An alternative view of the internals was given briefly, showing the details of how the elementary operations are applied to take the derivative of the simple expression x^2. This was intended to be somewhat a metaphor on how symbolic derivative computer programs work. The input function comes in on a conveyor belt. An eyeball on a stalk comes down and looks at it. (This is indicated by a dotted line running from the eyeball to the function). This is the pattern recognizer. The derivative operation is basically one of matching the desired function against a list of known patterns which are pulled down into the scene like window shades. When the proper pattern is found and checked, there will be some dummy parameters in the pattern which need to be filled in with the specific terms from the equation. The eyeball observes these and some handles come down and simultaneously turn all occurrences of the dummy parameter into the specific term needed. Identities such as x+0 or x*1 are removed by an eraser. The expression x+x is turned into 2x by a vise-like adder. The final expression is carried out on the conveyor belt.

Operation -- The lever on the top controls the operation of the Derivative Machine. When you throw the lever to the right, it takes an expression in the left hopper and spits the derivative out the right hopper. When you throw the lever to the left it takes an expression in the right hopper and spits out the anti-derivative (integral) on the left. Sometimes the expression stays put and the DM passes over it. Note, it doesn't evaluate integral expressions, it just takes the anti-derivative (i.e. you don't feed int x^2 in to get 1/3 x^3, you just feed in x^2.) As it operates, the horizontal and vertical scales cycle up and down a bit to give it a squash and stretch look.

5.2.3 Geometric derivative machine

Another representation of derivatives is graphical. When a function and its derivative are plotted above/below each other, the derivative curve is traced out by a mechanism that is a sort of geometric derivative machine. A tangent line slides across f with a spot at the point of tangency. A vertical line extends upward from the spot. A unit length horizontal line runs to the tangent line. The resulting triangle measures the slope of the tangent. The unit distance in the x direction causes the length of the y line to equal the derivative. The y piece is the "derivative color", which is echoed on the derivative plot, and traces out the derivative curve.

5.3 Vectors vs. Scalars

Vectors are arrows, of course. Ideally, scalars should be represented by some shape that doesn't have any directionality. Differently sized, filled circles would be ideal. The problem is that magnitudes cannot easily be compared, and there is confusion about area vs. radius as the representation. I could use speedometers, but there's an arrow for the indicator that might make it look like a vector. One can go crazy trying to out-think viewers on what they will be confused by. We used bar graphs.

5.4 Vector Fields

We had extensive dealings with vector fields, mainly representing electric and magnetic fields and hydrodynamic velocity flow fields. The basic concept to be illustrated is that each point in space has associated with it a vector E=E(x,y,z).

5.4.1 Representation

When vector fields are introduced they are shown with a hand moving a test charge around and the resultant force vector growing, shrinking and changing direction appropriately. The problem is how to show the essence of the entire field in one picture. There are two traditional ways to do this that were used in MU. Each of them raised problems and yielded some interesting insights.

Trail of Arrows -- You can represent a vector field by placing a vector arrow with its tail at x, y, z and its magnitude and direction having the value of the field there. There are two problems with this:

Field Lines -- Another classic technique is to display field lines. These are defined as lines, starting at "sources" (e.g., positive charges), curving toward "sinks" (e.g., negative charges), and staying tangent to the direction of the field at each point. The strength of the field is represented by the spatial density or closeness of the field lines.

A note about rendering. Depth cueing is important to make complex collections of lines easy to interpret. The opacity of the lines is what is depth cued. This runs from maximum, at the near clipping plane, to minimum, at the far clipping plane. To make this show up, you must make these planes as tight a bound on the scene as possible. If near is too near, or far is too far, the depth cueing will be to subtle. If the scene move in, or pulls back from the object being viewed it is necessary to animate the location of the near and far planes to keep a tight boundary. Also the lines are drawn sorted in Z so nearer (more opaque) lines overlay farther more transparent lines. Finally the brightness of the lines is gradated across the line to give a more solid "cylindrical" effect. (Using real cylinders here would look bad, they get bigger and smaller with distance and so look too "solid".)

5.4.2 Introducing lines

When this concept is introduced, a "fur" of lines actually grows out of the positive charges, continuing to extend themselves until they hit negative charges, or go off to infinity. At each frame, the lines all terminate at a surface of constant electric potential. This threshold potential is animated as a linear function of frame number.

Once a field line is drawn, there is no longer an obvious visual key as to the direction of the field along a line. On occasions where this is important arrowheads are included. Some other ideas were toyed with, like cycling some dots along the lines, but these were rejected as making the image too complex.

5.4.3 Placement of Field Lines

A particular line can be generated numerically (see next chapter) from any given seed point. The real problem is, where to place the seed points. The placement of seed points must be arranged to make the spatial density of lines properly represent the strength of the field.

5.4.4 2D vs. 3D

Here we encounter some difficulty with many textbook diagrams that simplify the problem to 2D. For example, consider a point charge. An obvious distribution of the field lines in 2D is to make them equally spaced radially about the point. If you now place two opposite charges on either side, but unequally spaced along a straight line there are problems. The wrong number of lines connects from the center to each of the side charges. This was very perplexing until we finally referred back to Maxwell's original book and realized that the entire situation has cylindrical symmetry in 3D. The lines must start out equally spaced in 3D in order work properly. This means they must be unequally spaced radially in the 2D plane, anticipating an effective rotation of the 2D diagram about the axis of symmetry in order to make the 3D diagram.

5.4.5 3D placement

The easiest way for the field line density to be correct in 3D is to begin the seed points at regions of known, simple geometry and field strength. Then their properties, and the properties of space, will keep them at the proper density. Some examples of simple starting situations are:

Constant Field -- Take a plane perpendicular to the field. Pierce it with a regular grid of field lines. The spacing must be proportional to the square root of the field strength.

Point Charge -- Start near point charges and use a radially symmetric set of seed points. Generating a set of radially symmetric points around a point is an interesting geometric/topological problem. One can use, for example, the vertices of a regular polyhedron (as was done here). The problem comes in a scene where there are two charges, with one twice the size of the other. Given a set of points about the smaller charge, how do you make exactly twice as many points symmetrically about the larger charge (regular polyhedra only come in 4,8,6,12,and 20 vertex versions).

Magnetic Field around Wire - Consider the magnetic field around a current carrying wire. The field strength is inversely proportional to radial distance from the wire. The field direction is perpendicular to the wire. A particular field line is just a circle surrounding the wire and perpendicular to it. The question is, what should the radii be?

Consider a plane containing the wire. The lines are all perpendicular to this plane. Consider the spacings of the field lines through a rectangle in this plane. The magnetic flux through the rectangle is the integral of the field strength over that rectangle. The number of lines is proportional to the magnetic flux. Integrating the 1/r field between two radii gives a flux that goes as the logarithm of the radius. Given a rectangle stretching radially from r_0 to r_1, the number of field lines is

N=k(ln r_1 - ln r_0)

or

r_0 e^(N/k) = r_1

Plugging integer steps for N shows that the radial spacing of the circular field lines should go exponentially. That is, the radii of two successive circles should have the same ratio.

This technique can be applied to other circularly symmetric fields such as dipole fields. The general technique is

This was done numerically for many situations, such as the magnetic dipole, which are analytically complex. Note that B-> infinity as you get closer to the wire, the number of lines gets infinite there. Contrast this with E-> infinity as you get closer to a point charge, the number of lines is constant, just density goes to infinity.

5.4.6 Dynamic Fields

What happens when the field strength is changing with time? How should the seed points move as functions of time?

In fact, you don't even have to consider time. The problem arises even with static fields. Since anywhere you start a set of field lines is as good as anywhere else, a perfectly consistent picture is made by any field line collection that just satisfies the density constraints on each individual frame. Each frame could have a different distribution, each of which individually satisfy the density constraint. This is obviously a problem, we shouldn't introduce motion where there is none. Consider some particular cases.

5.4.7 Constant direction, Varying magnitude

The lines are on a regular grid, scaled by 1/(sqrt(F)). This means that the center of scaling doesn't move, the field lines seem to 'breath' in and out.

5.4.8 AC Solenoid field

Consider the magnetic field of a solenoid with applied AC. For a given current (B field strength) there is no indication of field strength except as the distribution of seed points. The shapes of lines will be same no matter what the strength of the field. I used starting points generated by integrating the field strength across face of the magnet.

5.4.9 Electromagnetic Plane Wave

Consider the plane containing the propagation direction and perpendicular to the electric field. The field strength (ignoring some constants) is

E = k sin (x+t)

At a given time, the field lines should be in dense rows where sin is large, and be absent from rows where sin is zero. As time progresses, a dense row could 'breathe out' getting sparser and sparser until it's empty. Simultaneously a nearby empty row would 'breathe in'. While this is a perfectly consistent representation, it seemed to complex. We just had the rows themselves translate forward along the direction of propagation.

5.4.10 Capacitor field

How about field lines between plates in a capacitor. Made of a bent spiral so that as the scale changed (breathing mode) proportionally to sqrt(E), field lines drop off the edges of the plates at a uniform rate.

5.4.11 Induction

B field lines going thru a conducting loop as B field collapses. Topology changes. Life gets complex.

5.4.12 Special Problems with Electromagnetic Fields

There is an additional problem with animated illustrations of electrostatic fields. You are tempted to show the shape of the field by ``flying around'' the field lines. With electrostatics, the field lines don't change. If either the charges or the observer move, there are electrodynamic effects; ripples move along the field lines. This can be explained away or minimized by carefully picking time and distance units, but it's the overall effect that worried me. But a static view of 3D field lines is not as comprehensible as being able to fly around it. I finally did some gradual rotation of the view, or rocking back and forth, but avoided too violent motions.

5.4.13 Remaining problems and ideas for further work

I feel we have just scratched the surface of this subject. Just thinking about the problem of correct placement of seed points and about where they imply the field lines will go is a very interesting process. Some situations were still too complicated to do correctly. As an example, consider the field of a planet like Uranus interacting with the Interplanetary field generated by the sun. Correct spacing of field lines about surface of planet. As the planet rotates the topology changes.

5.5 Vector Calculus

5.5.1 Derivatives

Derivatives of vectors. geometric construction

5.5.2 Line Integrals

Initial nudge with finger in + and - directions. Then continuously accumulate integral as finger pushes point through smooth path. Finger always points tangent to path and represents dr.

Integrating delta W (work) for test charge, the finger moved an actual charge. Integrating deltaV (voltage) there was no test charge. Finger just moved around path.

5.5.3 Surface Integrals

Color in area with fist as dPhi = F dot dA accumulates. Show number of lines, adjusting color and opacity of surface so intersections are visible. Puffs of smoke as they pierce. Integral over closed surface shows punctures, (could do better since no distinction between + and - for entering/exiting.)

5.6 Wave interference

The program on optics deals mostly with wave interference. To show constructive and destructive interference it is necessary to be able to visually add two waves. The problem comes in that the values can be negative. Solution was to make medium gray stand for 0, black for -1 and white for +1. A null situation is a medium grey field. Waves are alternating black and white ripples moving through. They add nicely and interference looks natural. We actually used yellow instead of white to give the impression of electric field intensity (yellow).