The Function Visualizer _______________________ The Function Visualizer (FV) is a software implementation of mapping diagrams, with the added feature of animation. FV was created by Mark Bridger (Northeastern University) and Hubert Hohn (Massachusetts College of Art), with partial support from the National Science Foundation. FV may be copied and distributed for non-commercial purposes, and is copyright 1994-1996 by Northeastern University. Copies of the Visualizer, for either the Mac or PC, can be downloaded from Northeastern's FTP site at: WWW.MATH.NEU.EDU, or from the Math Archives. (Northeastern's site will always have the latest version.) 0. Starting and Exiting To start from DOS, run the executible program FV.EXE. To start from Macintosh, double click the icon. To exit from either, click on the small box in the upper left-hand corner. 1. The 2 Graphics Windows In the upper right the graph of the function is shown in purple (increasing) and green (decreasing). The window will also display a graph of the derivative, in orange, if you click on the box labeled: Show Derivative. Click on the box again (which now reads Hide Derivative) to turn off the derivative plot. When the derivative is turned on, a symbolic representation of the derivative will be displayed at the bottom of screen. The plot is always scaled to fit the function, so the derivative may go out of view. On the left is the mapping diagram for the function: the left vertical bar represents points in the domain, the right vertical line points in the range. A large number of lines are drawn in, connecting equally spaced points x in the domain with their image points f(x) in the range. Lines are draw from each domain point x; if f(x) does not lie on the part of the range shown, this "mapping line" is clipped off where it exits the mapping window. If the function is not defined at a particular point, the mapping line will not be drawn. If you move the mouse cursor up and down within the mapping window, the point x on the horizontal level of the cursor is highlighted, along with the line joining it to f(x). Simultaneously, the values of x, f(x) (and f'(x) if Show Derivative is turned on) are displayed along the top of the screen, and the lines joining (x, 0) with (x, f(x)) and (x, f(x)) with (0, f(x)) are shown in the graph at the upper right. If you move the mouse cursor from the very bottom to the very top of the mapping diagram, at a constant upward velocity, you can watch how the images of the points vary. These images will move quickly where the function is either increasing or decreasing rapidly. (In the mapping diagram, the vertical line representing the domain has horizontal coordinate 0; the range line has horizontal coordinate 1. As you move the mouse cursor, its horizontal coordinate, a number between 0 and 1, is also displayed at the top of the screen. This is useful for certain technical analyses of mapping diagrams; see the author's paper: Dynamic Function Visualization.) 2. The Function The default function is x-->sin(x), which is displayed in a box just below the mapping diagram. Clicking on this box enables you to edit (just type, backspace, etc.) or delete (press [Esc]) and enter a new function. You must use x for the variable, and * for multiplication. If you make a syntax error, it will be pointed out for correction. Various special functions are available for your use, and very complicated functions can be built from them. You can also type in "pi". Here is an example of a function that can be entered: exp(sqrt(2*x-x^2)) - tan(pi+ln(x)/12.779). Arbitrary powers are entered using "^", but positive integer roots are best entered using the "rootn" function; for example, the cube root of 1/x would be entered as: root3(1/x). 3. The Domain and Range By clicking on the boxes to the upper left and lower left of the mapping diagram window, you can reset the domain of the function by entering new numbers. You can erase the current number by pressing [Esc]. The upper right and lower right boxes set the range. In the present version, the range is restricted to [-1000, 1000] but this will probably be changed in future versions. (By multiplying your function by a suitable scaling factor you can get around this restriction.) You can also change the domain by dragging the small horizontal sliders on the domain bar: put the mouse pointer on one of them, hold down the mouse button and drag it up or down; release the mouse button at the desired setting. The effects of changing the range and domain are not immediately displayed. To redraw with the changed setting(s), you click on the commands in the window in the lower right: ************************* ** ************************* * Clear * Point Trail * ************************* * Redraw * Equi * ************************* * Center * Rescale * ************************* *Width*--|--*Speed*--|--* ************************* * Screen Dump * ************************* * Redraw will replot both graphics windows using the current function, domain and range. Note that the domain and range may have different scales, and their origins (0) may not be at the same horizontal level. Furthermore, for an x in the domain, f(x) will not appear on the screen if it lies outside the established range; in the case, the mapping line will be clipped. * Rescaling changes the range interval so that it exactly encompasses the image of the domain. The program estimates, for the given domain, the Min and Max of the function on that domain, sets the range to [Min, Max], and redraws everything. * Equi sets the range exacly equal to the domain, then redraws both windows. This is useful when iterating functions, or when it is desirable to see the exact amount of scaling and shifting performed by the function. In this case, domain and range have exactly the same scale, and each number s in the domain will align horizontally with s in the range. * Centering is a little more complicated: its function is to preserve scale by making the domain and range intervals have the exact same length. However, unlike Equi, Centering makes sure that the new range interval actually contains points in the image of the function. Here's what Center does. Suppose the domain is [a, b], L = (b-a)/2, and Min and Max are as just described. Let Mid = (Min + Max)/2. Center sets the range to [Mid - L/2, Mid + L/2]. Centering is useful for examining how a function expands or shrinks distances (scaling). While the domain and range have the same scale, their actual values do not necessarily line up horizontally as they do after the Equi command. 4. Point Trails Clicking the Point Trail puts you in point trail mode. If you now click anywhere in the mapping diagram, the point x on the horizontal level of the mouse cursor will move toward f(x), leaving a trail of dots. You can do this over and over. To erase these trails of dots, click on the Clear box; this will also get you out of Point Trail mode. 5. Animation The most novel feature of FV is its ability to have ALL the points in the domain move toward their images. What makes this useful and interesting as that they don't all move at the same speed. Each point x moves rightward on a line toward f(x), at a horizontal speed given by: k + K*|f'(x)|. The constant k, which is a minimal speed, is set by sliding or dragging the indicator in the Speed box on the right. The constant K, which represents the spread of speeds is set by sliding the indicator in the Width box. The bigger the absolute value of the derivative at x, the faster x moves rightward toward f(x). Points where |f'| is largest move fastest, and arrive at the range line soonest. Critical points (where f'(x) = 0), of course, travel slowest. Click on Animate Interval to see this animation. Holding down on the Mouse Button causes animation to pause, while clicking on either Step button stops animation. Click on Step with one of the two arrows, < or >, to see the animation one frame at a time, backward or forward, or hold down the mouse button for slower animation. (Backward motion shows the behavior of the inverse function.) 6. Screen Dump If you have a Macintosh, or DOS computer connected to a LaserJet or compatible printer, you can send a copy of the current screen image to be printed. MAKE SURE YOUR PRINTER IS CONNECTED AND ONLINE. Simply click the Screen Dump button. These are the main features of FV, the Function Visualizer. Other pedagogical and mathematical features are discussed in "Dynamic Function Visualization" (College Math Journal), a paper by Mark Bridger. Comments and questions should be addressed to Prof. Mark Bridger, Mathematics Department, Northeastern University, Boston MA 02115, or BRIDGER@NEU.EDU.