home *** CD-ROM | disk | FTP | other *** search
/ Esprit de Apple Corps / EDAC-2.iso / Graphics / Apps / Programs / MathGraphics / MathGraph.Doc < prev    next >
Encoding:
Text File  |  1994-03-25  |  18.3 KB  |  324 lines

  1.                 MathGraphics
  2.                   Version 2.2.1
  3.  
  4.                          Utility Apfel Research Kitchen
  5.  
  6.  
  7. Copyright (c) 1994    Dirk Froehling
  8.                 Oerlinghauser Weg 8
  9.                 D-44149 Dortmund
  10.                 Germany
  11.  
  12. Internet:     dirk@gaga.maschinenbau.uni-dortmund.de
  13. GEnie:            D.FROEHLING
  14.  
  15. --------------------------------------------------------------------
  16. This program contains material from the ORCA/Pascal and ORCA/C Run-Time Libraries, copyright 1984-1993 by the Byte Works, Inc. Used with permission.
  17. --------------------------------------------------------------------
  18.  
  19. Introduction
  20.  
  21.   MathGraphics does not run without System Software 6.0 or higher! And it must be copied by a program that supports extended files, e.g. the Finder.
  22.   This program can be used to draw graphs of functions of the type f(x) or x(t)/y(t) and to draw paired values from text files. MathGraphics uses the standard IIGS graphical interface.
  23.   The computed graphs are QuickDraw pictures which can be imported into DTP programs like AppleWorks GS, manipulated and printed at any resolution. MathGraphics saves the function, the drawing area etc. as a resource together with the drawing.
  24.   You can also use a HP-GL compatible plotter to display the function.
  25.  
  26.   This program is SHAREWARE, so everyone can copy and try it. If you like it and want to use it after a two weeks trial period, send $15 (or a roughly corresponding amount in your country's currency) to the address above. You will get the newest version of MathGraphics and you will be able to get updates at a small charge. I also welcome your comments!
  27.   Let me know if you have a FPE or NumberCruncher coprocessor card, so I can send you a version of MathGraphics which uses these cards directly and operates much faster.
  28.  
  29.  
  30. Updates since version 1.8:
  31.  
  32. 2.0    -    parameter functions (x(t), y(t))
  33.     -    logarithmic drawing area
  34.     -    finding roots and extremes of functions
  35.     -    drawing function strings
  36.     -    dottet lines for grid and function values
  37.     -    animated cursor (courtesy of Wilfried - Hi, Wilfried!)
  38.     -    a few of minor changes
  39.  
  40. 2.1    -    removed bug concerning e^x
  41.     -    textcursor
  42.  
  43. 2.2    -    every window has its own settings, functions, etc.
  44.     -    choosable font
  45.     -    GS/OS╩class 1 calls
  46.     -    requires System 6.0 or higher
  47.     -    rearranged menus
  48.     -    input file for the drawing of paired values has to be a
  49.         formatted text file
  50.     -    MathGraphics uses a new, more complete format for storing
  51.         settings in the picture files
  52.  
  53. 2.2.1    -    thermometer bar for ROM 03 GS (Showing the drawing process on the 
  54.         screen caused the picture to disappear partially.)
  55.     -    addressed inkompatibilities with printer drivers from Vitesse
  56.     -    first click inside a drawing after loading it from disk gives correct
  57.         results now
  58.     -    'Print' menu item shortcut is command-P
  59.     -    Print Record is saved in the preferences file
  60.     -    loading of documents via the MessageCenter (double-click on a
  61.         dokument) works (again)
  62.     -    clipboard can be shown (with System 6.0.1)
  63.     -    a few cosmetic changes
  64.  
  65.  
  66.                 Manual
  67.  
  68. Mouse Handling
  69.  
  70.   Inside the content area of an active window the cursor becomes a cross. If you click on a point inside the active window, an alarm box will be displayed, showing you the function value and the derivatives at this point.
  71.   If you hold the mouse button and drag the mouse, a rectangle will be drawn that lets you define an area which will be displayed in a dialog box when you release the mouse button. This dialog gives you the choice to use this area as the drawing area by pressing 'Drawing Area', or to find the function root or an extreme by pressing 'Function Root' or 'Extreme', respectivly. To find a root, the function graph must cut the x-axis inside the area. In order to find an extreme, this must also lay inside the selected area. The program is able to distinguish between a minimum and a maximum. The extreme can then be drawn if you like.
  72.   The two buttons 'Function Root' and 'Extreme' are disabled when you use the parameter option (described below).
  73.   If you click on a point inside the window while holding down the option key, a dialog appears, which lets you choose between drawing one of the function strings or any text you like at this point.
  74.  
  75.            
  76. Apple Menu
  77.  
  78. About MathGraphics...
  79.  
  80.   This command displays a dialog box with information about MathGraphics (version number, build-in functions etc.).
  81.  
  82.  
  83. (Desk Accessories)
  84.  
  85.   Desk Accessories are supported by MathGraphics.
  86.  
  87.  
  88. File Menu
  89.  
  90. New
  91. Open...
  92. Close
  93. Close All
  94.  
  95.   The 'New' command creates a new, empty window. There can be up to four windows open at once.
  96.   With 'Open' you can load a document of type $C1 (a QuickDraw picture or an unpacked bitmap) created by MathGraphics or another program. It will be displayed in a new window. A QuickDraw picture is a recording of QuickDraw drawing commands that will be played back when you want to see or print it. It can be resized and uses the maximum resolution of the device it is displayed on. So you get a better looking result when you print it as if it was a bitmap.
  97.   Files created by MathGraphics contain information about the function, drawing area and more in the resource fork. If no such information is found, the standard preferences will be used.
  98.   The 'Close' command closes the active window, 'Close All' closes all windows (you guessed it!). If you have made any changes to the document you're closeing, you get the chance to change your mind and leave it open, save it or discard the changes.
  99.  
  100.  
  101. QuickDraw Picture
  102. Bitmap
  103.  
  104.   You can change the kind of graphic that will be saved with this command. The active option has a check mark in front of its name. 'QuickDraw Picture'╩should be preferred, but the 'Bitmap'╩option is useful for importing MathGraphics drawings into GraphicWriter III v1.0, for example.
  105.   
  106.   
  107. Save
  108. Save As...
  109.  
  110.   The 'Save' command puts a copy of the active document on disk. If it hasn't been named already, you have to name it in the Standard File dialog. 'Save As' lets you change the name and path of the document.
  111.   The active preferences will be saved in the resource fork. The file is still compatible with all graphic or DTP programs that can load $C1 files, but you will loose this information if you load a file into such a program and save it again under the same name.
  112.  
  113.  
  114. Page Setup...
  115.  
  116.   This command displays the page setup dialog of the currently active printer. To alter the active printer you have to use the control panel.
  117.  
  118.  
  119. Print...
  120.  
  121.   The 'Print' command prints a copy of the current document according to your specifications. Since QuickDraw pictures are used, MathGraphics can print the graphic at any resolution.
  122.  
  123.  
  124. Quit
  125.  
  126.   Quit lets you exit MathGraphics and return to the launching program, e.g. the Finder. The current content of the clipboard will be saved on disk.
  127.  
  128.  
  129. Edit Menu
  130.  
  131. Undo
  132. Cut
  133. Copy
  134. Paste
  135. Clear
  136.  
  137.   If the active window is a MathGraphics window, the commands do the following: 'Undo' reverses the last drawing activity. You can undo all the drawings you made (e.g. overlaying function graphs) until the window is empty. 'Clear' does that all at once. With 'Cut', 'Copy' and 'Paste' you can move the whole graphic into the clipboard and back. The clipboard will be saved if you exit MathGraphics, so you can use its contents in another program.
  138.   If the active window belongs to a NDA, the meanings of the Edit menu commands depend on this NDA.
  139.  
  140.  
  141. Preferences...
  142.  
  143.   With this dialog you can control the appearance of numbers in dialogs and as labels of the coordinate system. You can choose between float and fixed format (e.g. 1.234e+5 or 25.00) and enter the number of decimal places you like.
  144.   If 'Show Drawing Process' is active, you can watch the functions as they are drawn. If it is inactive, a thermometer bar is shown that displays the progress of calculating and drawing. This latter option should be choosen by users with a ROM 03, where pictures seem to disappear partly after the complete drawing otherwise.
  145.   Pressing 'Save'╩lets you replace the standard preferences of MathGraphics by the settings of the frontmost window and the current printing options. They are saved at '@:MathGr.prefs', where '@' is the prefix of the folder containing MathGraphics, or if you started it from a server, of the user folder.
  146.  
  147.  
  148. Choose Font...
  149.  
  150.   You can change the font of the active window with the standard Choose Font dialog here.
  151.  
  152.  
  153. Show Clipboard...
  154.  
  155.   The current content of the clipboard is shown in a window, wether it is text, graphic or sound. This menu item is only active with System 6.0.1.
  156.  
  157.   
  158. Graphics Menu
  159.  
  160. Enter Function(s)...
  161.  
  162.   You can enter function strings with a lenght up to 255 characters. Upper or lower case makes no difference, spaces are allowed. The string can be edited like normal text, and you can cut, copy and paste it with control-x, -c, -v.
  163.   The function will be evaluated useing the common mathematical rules (braces first, then * /, then + - etc.). The available functions are listed in the 'About' dialog:
  164.  
  165. abs(x)        - positive value
  166. int(x)        - round to nearest integer
  167. frac(x)        - remainder of truncate to integer
  168. sqr(x)        - square
  169. sqrt(x)        - square root
  170. sin(x)        - sine
  171. cos(x)        - cosine
  172. tan(x)        - tangent
  173. arctan(x)    - arctangent
  174. exp(x)        - base-e or natural exponential
  175. ln(x)            - base-e or natural logarithm
  176. sinh(x)        - sine hyperbolicus
  177. cosh(x)        - cosine hyperbolicus
  178. tanh(x)        - tangent hyperbolicus
  179.  
  180. The arguments for the trigonometric functions and the result of arctan are expressed in radians.
  181. You can use four definable (a, b, c, d) and two predefined constants (pi = 3.14159..., e = 2.71828...). If the program finds an error in the string, it beeps.
  182.   The appropriate dialog is choosen automatically, depending on whether f(x) or x(t), y(t) is used. If the 'Paired Values'╩option is active, this command is not available.
  183.  
  184.  
  185. Draw...
  186.  
  187.   'Draw...' displays a dialog that depends on the type of function choosen (f(x), x(t)/y(t) or Paired Values).
  188.  
  189. Drawing of a function:
  190.  
  191.   You can enter the values of the constants you can use in the function string. This is useful if you want to display the influence of a constant in the function by drawing it several times with a different value.
  192.   Three radio buttons are provided to choose from displaying the function(s), its (their) first (slope) or second derivative(s). If you draw x(t) and y(t), both functions will be derivated if you choose f'(x) or f''(x).
  193.   The 'polar' option lets you draw the function as r(phi), that means x corresponds to the angle and f(x) to the radius. It is deactivated when you use logarithmic scaling or parameter functions.
  194.   Choosing a low accuracy gives a quick overview of the function graph, a higher is recommended for best printing results. If you select OK, the graph will be drawn. You can stop it at any time by pressing Open-Apple-period.
  195.   
  196. Displaying a Data File:
  197.  
  198.   Although MathGraphics is able to draw a lot of trigonometric functions that can be combined to long and complex function terms, you may want to display a graph of a function that is not analytically describable (e.g. solutions of differential equations solved numerically) or other data. You can solve problems with your own programs and let MathGraphics draw it.
  199.   MathGraphics suspects a text file with data set of two or more components. You can choose which component of the set contains the
  200. x or the y values.
  201.   Maybe you have a solution of a movement equation. You save the time, place, velocity and accelleration of a state in a set with four elements. Then you you can take the time for for the x value and display the other elements against it, display accelleration against velocity or whatever you like. If the values are radius and angle, select Polar Coordinates Transformation in this dialog.
  202.   MathGraphics has to know about the number of components. Otherwise it
  203. cannot use the correct step lenght and will draw funny looking pictures.
  204.   To select the data file, press the corresponding button and use the Standard File dialog. MathGraphics scans the file for extrem values and suggests a drawing area. This is useful for the first graph you draw. But if you want to compare functions, you should leave the area as it is after the first graph.
  205.   A data file has to have the following form:╩First the number of data sets, then the components of the sets, seperated by spaces, colons, tabs or returns. Everything after a '/' in a line will be ignored. MathGraphics uses the 'Number Of Components' setting in the dialog to assign each number to the correct set and component.
  206.   Here is an example for such a file:
  207.  
  208. / Data for MathGraphics
  209. /
  210. 3 / number of data sets
  211. /
  212. 0, 100, 20    / time, place, velocity
  213. 0.2, 110, 23
  214. 0.4, 90, 25
  215. /
  216. / End
  217.  
  218.   Pascal example (just the important code snippets) for producing a data file:
  219.  
  220. const n=100;
  221.  
  222. var   i: integer;
  223.       a: array[1..n, 1..2] of extended;
  224.       Textf: text;
  225.  
  226. rewrite(Textf, 'Werte.txt');
  227. writeln(Textf, n);
  228. for i := 1 to n do
  229.   writeln(Textf, a[i,1], a[i,2]);
  230. close(Textf);
  231.  
  232.  
  233. C example:
  234.  
  235. #define N 100;
  236.  
  237. typedef double array[N][2];
  238.  
  239. int     i;
  240. array   a;
  241. FILE    *Textf;
  242.  
  243. Textf = fopen("Values.txt","w");
  244. fprintf(Textf,"%d\n", N);
  245. for(i=0;i<N;i++)
  246.   fprintf(Textf,"%12.5f %12.5f\n", a[i][0], a[i][1]);
  247. fclose(Textf);
  248.  
  249.  
  250.  
  251. Function Value...
  252.  
  253.   In this dialog you can enter an x value whose function value will be computed. This value can be included into the drawing. MathGraphics draws lines from this point to the axes.
  254.    This menu item is deactivated when you use parameter functions.
  255.  
  256.  
  257. Drawing Area...
  258.  
  259.   The drawing area refers to the window boundary. The values you enter take effect for the function and the data file drawing. The seperate values for the drawing interval on the x axis allow for drawing interceptional defined functions. The values must lay inside the drawing area, unless polar or parameter function options are activated. In this case the interval is treated like a angle or 't' interval and can be choosen as desired.
  260.   You can accieve equal units for both axes with the buttons '1:1', '2:1' and '1:2'. They compute the upper boundary of the choosen axis according to the other. For the screen and printing with "normal" option one should use the '1:1' button, for printing with 'condensed' option the  '2:1' and '1:2' buttons.
  261.   Logarithmic scaling is choosen with the radio buttons 'xlog', 'ylog' or 'xylog'. One or both axes will be divided logarithmic (base 10) and the minimum has to be bigger or equal to one.
  262.  
  263.  
  264. Axes & Grid...
  265.  
  266.   With this dialog you can specify the coordinate axes or grid you want to draw. The axes can be drawn through the point (0,0) or at the left and bottom boundary of the window (if (0,0) isn't inside the drawing area). The distance between two ticks on the axes is selectable. The ticks can be labeled. If you want more ticks between labeled ticks you can draw the axes a second time with a smaller distance. The distances for the grid lines are entered the same way. You should draw the grid first and in a different color than the axes.
  267.   The font can be choosen with the 'Choose Font...' command from the 'Edit' menu. When drawing on the plotter the standard (resident) font of it will be used. 
  268.   The axes can be drawn with or without arrowheads.
  269.  
  270.  
  271. f(x)
  272. x(t), y(t)
  273. Paired Values
  274.  
  275.   You can choose between the given possiblities to describe a function or paired values with these menu items. With 'f(x)' the function value is evaluated depending on the point of the x-axis, with 'x(t), y(t)' both the horizontal and vertical values depend on the parameter t and the functions you choose for them. In this case the values for t are determined by the drawing interval from the drawing area dialog. 'Paired Values'╩switches to the correct dialog to draw data of a text file with the 'Draw...'╩command.
  276.  
  277.  
  278. 320x100
  279. 640x200
  280.  
  281.   These commands let you select the drawing size. The smaller one is good for importing the graphic into a text document, since there is less data to display by the word processor program, and if you scale it to fit for a special purpose after it has been drawn, you'll have to settle with lower quality.
  282.   If you switch between the drawing size and the window already contains a
  283. graphic, it will be scaled. Reducing it in size will make most of the (black) lines disappear because the pensize is scaled also.
  284.  
  285.  
  286. Color Menu
  287.  
  288.   This menu lets you choose between 16 dithered colors to draw with. The chosen color applies to all the following drawing operations.
  289.  
  290.  
  291. Plotter Menu
  292.  
  293. Activate... / Deactivate
  294.  
  295.   MathGraphics supports HP-GL (Hewlett-Packard Graphic Language) compatible plotters. If the plotter is not being used at the moment, you will see a dialog that allows you to select the slot it is connected to and to activate it. It will get initialised and scaled, and the drawing operations will be performed on screen and plotter simultaniously.
  296.   The Deactivate item simply turns drawing on the plotter off.
  297.  
  298. Commands...
  299.  
  300.   If you select this menu item, a dialog pops up to let you send commands to the plotter. You can use all HP-GL commands, but there is no syntax check. If you use LB to draw a string on the plotter, MathGraphics appends an EOT character automatically. The other commands will be terminated with ';'. This is requested by HP-GL.
  301.   The popup menu makes it easy to select a pen for the plotter. Changes in the Color menu have no effect on the plotter pen.
  302.  
  303.  
  304. Windows Menu
  305.  
  306. Clean up
  307. (file names)
  308.  
  309.   This menu is provided to ease the window handling. Clean up puts the windows in a neat order so you can see all title bars, and selecting one of the file names takes you directly to the corresponding window. The active window has a check mark in front of its name.
  310.  
  311.  
  312. Double Click on Documents
  313.  
  314.   Besides starting MathGraphics by clicking on the program symbol, you can start it by selecting a PICT or Bitmap file from the Finder and execute the Print or Open commands. You can open up to four files simultaniously. If the files should be printed there is no such limit since MathGraphics closes all files after they have been printed and before it loads the next one.
  315.   To use this feature you have to copy the MathGraphics icons to your startup disk and set the pathname to the folder containing MathGraphics. For example, if MathGraphics is in the 'math.programs' folder on your hard disk 'HD', you have to enter
  316.  
  317.   /HD/math.programs/MathGraphics
  318.  
  319.   This can be done with an icon editor (search for 'Edit Attributes' or 'Edit Extended parameters' in the menus). The file type of a MathGraphics document is $C1, the aux type $0000 for a bitmap file (super hires screen) and $0001 for a QuickDraw PICT file. You can also easily view and print files of these types created by other programs with MathGraphics.
  320.  
  321.  
  322.  
  323. Have fun with MathGraphics and tell me what features you'd like to see!
  324.