                          MathPlot
                          ========
                          
                    by Rdiger Dreier 1991/92/93
                          

This manual is a short version of the manual you get when you become
a registrated user. See "Registrierung.txt" for more information.

My address

 Rdiger Dreier
 Gustav-Winkler-Str. 40
 33699 Bielefeld
 Germany
 
I can be reached via EMail:
 
 ruediger.dreier@post.uni-bielefeld.de
 
 






Some legal stuff
================

    THE AUTHOR UNDERTAKES NO LIABILITY FOR ANY DAMAGE CAUSED BY THE
    APPROPRIATE OR NOT APPROPRIATE USE OF THIS PROGRAM !

    THE AUTHOR UNDERTAKES NO LIABILITY FOR THE FAULTLESSNESS OF THIS
    PROGRAM !

    USE IT AT YOUR OWN RISK !


    MathPlot is ShareWare !
    
    If you use this program, you have to pay the shareware fee.
    See "Registrierung.TXT"
    

This version of MathPlot
========================    
    
    This version is a demo version with a requester telling you that
    MathPlot is ShareWare.
    It may be freely copied under the following conditions:

    - The copyright text must be included (unchanged).
    
    - You are not allowed to earn money by copying this program (only a 
      little fee for disk, postage etc).

    - The program MUST NOT be changed.

    - The program must be complete: The following files must be included:

      - The complete unchanged documentation (one language is enough).
      - One working copy of MathPlot
      - A version of mtool.library

    - Everybody  who wants to use MathPlot (or a  part of it) or the
      mtool.library (or a part of it) in a commercial sense needs the 
      written permission of the author.
      
    - It IS allowed to translate the text of the menu item etc. (file
      TextDaten) into other languages and include it into any copy of this
      program. If you do so, please send me a version of the new textfile
      an tell me, if I am allowed to include this one in the shareware
      and full version of MathPlot.
      
    - It is allowed to upload this version of MathPlot to any mailbox and
      include it into any PD-disks serie (like Fred Fish's) as long as the
      price for one disk is not too high (that is, less than DM 5,-- or
      (US)$ 5,--). For CD's, the maximum price is DM 60,- or (US)$ 30,-.


The shareware fee
=================
      
    MathPlot is ShareWare. If you use this program, you may want to
    pay the registration fee. It is (US)$ 20,-- or DM 30,--. Please send 
    this money to the address above and add the name and version of the 
    program (and perhaps where you found it). Please use the form in
    "Registrierung.txt".

    'Why should I', you may ask. Well, you will get

    - The newest (full) version of MathPlot. This Version MUST NOT be
      given to others.

    - A printed manual (the full version of this one, please tell me, if you 
      want to have the german or english version).
      
    - Updateservice. You may get new versions of MathPlot by sending a disk,
      envelope, postage and your registration number to me. If there is no
      newer version, I will wait until there is one. So it may take a little
      time until you get the newest version. Please tell me, which version
      you have.
      If you can be reached via EMail, I can send you newer version as
      UUENCODE'd textfiles.
      

The source
==========

    The source is NOT freely distributable. The source is available (for 
    registrated users only) by sending (US)$ 20,-- or DM 30,-- to the
    address above. If you want to use the source in a commercial sense, 
    you need the written permisson of the author (ME !).



What this program does
======================

    MathPlot is a little program to plot twodimensional functions. You
    can enter up to 10 functions and plot them  all. In addition, you can
    plot the first and second derivation of the functions (numerical and 
    symbolic). A discussion and numerical integration is also possible.
    An ARexx-port is included.
    So the program can be used i.e. to control your own results.


What you need
=============

!!  The program only works on Amigas with Kickstart 2.04 or higher !. 
    1MB memory should be enough, 1MB chip mem and new custom 
    chips are very nice for big screen (productivity mode etc.). The stack 
    should be 20000 bytes or more. 
    In LIBS:, you need

    - mathieeedoubbas.library
    - mathieeedoubtrans.library
    - asl.library
    - mtool.library (should be also on this disk)
    - diskfont.library (V36 or higher)
    - iffparse.library (only for saving as IFF--file)

    In S: you can (but need not) have

    - mplot.prefs, a preferences--file.
    - Funktionen.fkt, some example functions
    - Konstanten.con, some constants
    - Macros.mcr, some macros.

    If you want to use the ARexx-Port, you should copy all files in
    Macros/ to rexx: (an "assign .... add" seems not to work).





The menus
=========

 Project
 -------
 
  New
  ---
    You are asked whether to clear the screen or not. A HP-output ends. The 
    screen clears automatically after changing the intervall.
    
  IFF Save As
  -----------
    To use this item, you need the iffparse.library in libs:. If the 
    program cannot find this library, a requester appears 
    (iffparse.library ?).
    Otherwise, you are asked for the name of the file. If an error occurs,
    another requester appears.

    The programm's icon is used for this file (if startet from Workbench).

  Load/Save functions/macros/constants
  ------------------------------------
    You are asked for the name of a file to load / save as.

 
  Print
  -----
    Prints the screen on your preferences printer (as big as possible).
    While printing, the colour of the screen is changed. A HP-output ends.

  Iconify
  -------
    The window is closed and an icon appears on workbench. A doubleclick
    on this icon starts the program again. The last functions are still 
    available. If there is not enough memory to open a screen, the program 
    terminates. As icon, the programm's icon is used (if startet from 
    Workbench).
    
  About
  -----
    You  get some pice of information about this program (Version, my
    address, name of the screen etc.). 
  
  QUIT
  ----
    A requester appears and asks you whether to quit or not. If you agree, 
    the program terminates. Cause the screen is a public screen, there may 
    be some "visitor windows". If there is one, the programm does not 
    terminate and a requester is shown.

 
 
 Plot
 ----
  
  Change function
  ---------------
    A submenu with the ten functions (you entered or loaded) appears (only 
    the first 14 characters are displayed).
    Here you can select one of the functions. A window appears and you can 
    change it. The function should be a correct expression.
    If you enter something like sin((x), the window appears again as long as
    there is one bracket too much. 

  Function 1st/2nd derivation num/symb
  ------------------------------------
    Each of this five items has the same submenu as Change. Selecting one of 
    the functions plots it (or its 1st or 2nd derivation).
    Symbolic derivations are calculated first and then the new function is 
    plotted (e.g. for sin(x): first cos(x) is calculated as the derivation 
    of sin(x) and then cos(x) is plotted).
    Symbolic derivations are  more precise but  there are problems with some 
    function (abs, sgn, ln). E.g. for ln you get the function 1/x plotted 
    even for negativ x. 
    Symbolic derivations are calculated in a recursive way, so the stack 
    should be at least 20000 bytes. If you get a guru, just try a larger 
    stack.

  Discussion
  ----------
    Here you can get some pice of information about the function:
    The intervall is displayed as well as the first and second derivation. 
    Also the points where the function is zero, has a min or max or a 
    turning point. 

    The derivations
    ---------------
     1. +-*/                 The usual 
     2. x^a                  a*x^(a-1)
     3. a^x                  a^x*\ln{a}
     4. f(x)^{g(x)}          (g(x)*\ln(f(x)))'*f(x)^{g(x)}
     5. trig. functions      The usual
     6. abs(x)               sgn(x) (For x=0 not correct) 
     7. int(x)               0 (Well ...)
     8. sgn(x)               0 (Well ...)

  IMPORTANT
  ---------
!!  THE AUTHOR UNDERTAKES NO LIABILITY FOR THE CORRECTNESS OF THE
!!  DERIVATIONS !!  BEFORE YOU USE ANY OF THE RESULTS, RECALCULATE
!!  THEM BY HAND !!!


  Num. Integration
  ----------------
    Here you can integrate a function numerically. A window appears 
    and shows the selected function (you can even change the function or 
    enter a new function).
    You are asked for the intervall and the number of steps to use for
    the numerical integration. If you use more steps, the result becomes
    better but you have to wait longer.
    To close the window, select QUIT.


    Errorcodes of the program
    -------------------------
     DIVBYZERO   &   1  &  division by zero 
     LOGNEG      &   2  &  log(<= 0) 
     SQRTNEG     &   4  &  sqrt{ < 0}
     ATRIG       &   8  &  asin, acos with arg >1 or <1
     UNPAKLAM    &   16 &  Too much brackets 
     TEST        &   32 &  Not used 
     NOFUNC      &   64 &  No function given 
     NO_KONST    &  128 &  No such constant 
     NO_MEM      &  256 &  No memory
     POWERROR    &  512 &  You tried (<0) ^ (a/b)
     NO_FUNC     & 1024 &  No function found
     ER_AHYP     & 2048 &  Error at acosh() or atanh()


 Edit
 ----
 
  Axis
  ---- 
    With the two subitems, you can add axis to you plot. When there is
    a plot, you can add axis only once. So test your axis before you plot.
   
  Zoom
  ----
    You get a rubberbanding and can select the part of the intervall
    which will be plottet next.

  Insert text
  -----------
    You can enter a text and place it with your mouse. Click at the right
    place and the text will be drawn with the selected font, colors
    and drawmode. 

  Precision
  ---------
    You get a submenu with four items (low, med, high and very high).
    If you select med, high or very high, the program needs more time to 
    plot and the plot becomes better.
  
  Intervall
  ---------
    A window with four stringgadgets, two cyclegadgets and two normal
    gadgets appears. In the text gadgets you can enter the intervall,
    with the cyclegadgets, you can tell the program how to use this
    values, e.g.: you want to plot [-pi,pi]. You can enter -pi and pi 
    and *1 in the cyclegadget. But you can also enter -1, 1 and *pi in 
    the cyclegadget. Try both and plot axis, you will see the difference. 
    To get a log/log plot, choose 10^ in both cyclegadgets and so on.
   
  Constants
  ---------
    A window with an active cyclegadget and an inactive stringgadget
    appears. Choose a character with the cyclegadgets or press a key, then
    hit RETURN. The stringgadget should become active. Now you can
    enter the definition for the constant, you named before. You can
    use constants in other functions by their name, e.g: define a
    constant z by entering pi. Then you can use z in any function
    instead of pi. Do not use x or e as name of a constant because
    they cannot be used later (e is defined as 2.7...).
     
  Macros
  ------
    A similar window as decribed in Constants appears. Enter your macro-
    definition in the stringgadget. Macros are used in functions via 
    _MACRONAME or _MACRONAME(parameter), e.g. _a or _a(2*x). If you 
    use the second way, every x in the macro is replaced by paramter.
     
  Plot-Output
  -----------
    This item has two subitems (on,off). >On< asks you for a name for a file
    to write the data in. >Off< switches HP-Output off (automatically
    done when changing the intervall or printing). After selection off, the 
    file contains HP-Plotter compatible data to plot all those functions and 
    text you plottet after selection >on<.
    I have no HP-Plotter, I used the PLT:-Device and it works.
  
  Select/Change Colours
  ---------------------
    Here you can change MathPlot's palette (there is one normal palette,
    one for printing and one for HP-output).
    The last active color in the requester is used as new color for
    plotting, too.

  Change Font
  -----------
    Here you can select an new font fr Insert text and the labels at the 
    axis and the screen. The standard font-requester is used.
    
  Change resolution
  -----------------
    Here you can select a new screenmode and enter the new resolution.
 
  Change pattern
  --------------
    Here you can define a new linepattern.

  Discussion
  ----------
    Use this to define some options for discussion.

 ARexx
 -----    
  Start ARexx-Macro
  -----------------
    The filerequester appears and shows all file with .mapl in rexx:.
    You can start a macro with a doubleclick. You should NOT start files 
    ending with .mpl. These file may need some more arguments.
  
  Define ARexx-macro
  ------------------
    There are 10 items to start a macro by just selecting an item. Use
    this item to define this macros.
    
  Record
  ------
    The program may record some actions (change functions, constants and
    macros, change intervall, change color and plot axis). You are asked
    to enter the name of the file to save the actions in. You can choose
    if the program saves its status in this file, too. 
    

   
 Preferences
 -----------
  The program differs between active options and preferences.
  Active options define the actual behaviour of the program (e.g.
  the color used for plotting the next function) while preferences defines 
  the behaviour of the program after startup (e.g. the color used for 
  plotting if the user has never defined one).
  Preferences become active options by selecting "Use" or restarting the 
  program.
  Most of the items in this menu are also part of other menus, so their 
  description is quite short here.

  Load
  ----
   Load a new preferences-file. These options become active.

  Use
  ---
   The preferences become active options. The screen will be closed and a 
   new screen will be opened with most of the new options.
   Only some options cannot become active by selecting "Use", see below. 
   For this options, you have to restart the program. 

  Save
  ----
   Save the options.

  Intervall
  ---------
   Enter the initial intervall.

  Select or change Colour
  -----------------------
   Change initial palette and color for plotting.

  Change Font
  -----------
   Choose the initial fonts, colors and drawmodes.

  Change pattern
  --------------
   Select the initial patterns.

  Precision
  ---------
   Set the initial precision. If you started without a .prefs-file, you
   MUST choose a mode and a depth.

  Set paths
  ---------
   This item only appears in this menu. On startup, the program load a
   file with all texts, a file with the initial functions, one with the
   initial constants and one with the initial macros. These file can
   be defined here. You have to restart (not just select "Use") to
   use this options.
   In addition, you can enter the initial path and filename for the
   iff-filerequester, rexx-filerequester and other filerequesters.

  Shortcuts
  ---------
   Thie item only appears in this menu. You can change the keystroke
   equivalences for the gadgets. A stringgadget with some characters
   appears:
    - the first character is the upper case to be equivalent to
      clicking on OK.
    - the second charackter is the upper case to be equivalent to
      clicking on Cancel.
    - the next 4 characters are the equivalent to clicking in a string-
      gadget.
    - the next 4 characters are the equivalent to clicking on the cycle-
      gadgets in the intervall-requester.
    - the last 6 characters are the equivalent to the slidergadgets in
      the palette-requester.
   Then, the same requester appears for every menu to ask for a
   shortcut.
   
  Discussion
  ----------
   Here you define the initial options for discussion.



   
Options and inputformats
========================

 Format of functions
 -------------------

  The functions can consist of ()+-*/^, sin, cos, tan, log, int, sgn, abs,  
  sqr, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, ln and the 
  constants a-z (without x and e) and the  variable x. e (2.7...) and pi 
  (3.14...) are already  set. Numbers must be in a usual format
  (1; 1.1; .1; 3e5; 5d-7...). Macros are used as _NAME or _NAME(parameter).
  Use brackets to make sure, MathPlot calculates the function, you want.
  It uses the normal mathematical rules (^ before *,/ before +,-).

 Options
 -------
  MathPlot loads s:mplot.prefs on startup. You can choose a different
  file by using the tooltype SETTINGS.


ARexx-Port
==========
 Introduction
 ------------
  MathPlot has now an ARexx-Port (the name is "MPlot_ARexx"). The code is
  generated with ARexxBox V1.00 which is  by Michael Balzer. 

  
 ARexx-Commands
 ---------------
  Here is a list of all commands. The format of the templates corresponds
  to the way the system displays command templates in the Shell. Look in
  your manual to understand the meaning of all those characters after a "/".
    
   BEEP
    A simple DisplayBeep()
   CLEAR FORCE/S
    Clears screen. With FORCE, there will be no requester.
   EVALSTRING VAR/K,STEM/K,FUNCTION/A,X/K => VALUE
    Evaluates a string.
   FAULT VAR/K,STEM/K,NUMBER/N/A => DESCRIPTION
    Not implemented.
   GET1DERIVE VAR/K,STEM/K,NUMBER/N/A => DERIVE
    Gives you the first symb. derivation of a function. The functions are
    referenced by number, 0 is the first in the subitem, 9 the last.
   GET2DERIVE VAR/K,STEM/K,NUMBER/N/A => DERIVE
    Look above.
   GETCOLOR VAR/K, STEM/K, TEXTCOLOR/S, AXISCOLOR/S, PLOTCOLOR/S,
                           TEXTCOLORBACK/S, AXISCOLORBACK/S, 
                           TEXTMODE/S, AXISMODE/S => 
                           TEXTCOLOR/N, AXISCOLOR/N, PLOTCOLOR/N,
                           TEXTCOLORBACK/N, AXISCOLORBACK/N,
                           TEXTMODE/N, AXISMODE/N   
    Gives you the number of the colors and drawmodes.
   GETCONST VAR/K,STEM/K,NAME/A => DEFINITION
    Gives you the definition of a constant. The name must be a character.
   GETERROR VAR/K,STEM/K => NUMBER/N
    Give you the last error.
   GETFUNCTION VAR/K,STEM/K,NUMBER/N/A => DEFINITION
    Look above (GETCONST).
   GETINTERVALL VAR/K,STEM/K,XAXIS/S,XMIN/S,XMAX/S,YAXIS/S,YMIN/S,YMAX/S 
    => DEFINITIONSTRING,DEFINITIONNUMBER/N
    Gives you the definition of the intervall. Use only one switch a time.
   GETMACRO VAR/K,STEM/K,NAME/A => DEFINITION
    Look above.
   GETPOINTS VAR/K, STEM/K, FUNCTION/A, ZERO/S, MAX/S, TURN/S 
                            => XPOINTS/M, YPOINTS/M, TYP/M   
    A discussion via ARexx. Only one switch at a time !
   GETPRECISION VAR/K,STEM/K => PRECISION/N
    Gives you the precision.
   HELP VAR/K,STEM/K,COMMAND,PROMPT/S => COMMANDDESC,COMMANDLIST/M
    Gives you a list of all commands or the template for one command.
   HPGL_ON FILENAME
    Switch on HPGL-output
   LABELPEN COLOR/N
    Set pen for axis.
   LOADCONST FILENAME
   LOADFUNC FILENAME
   LOADMACRO FILENAME
    Load the definitions.
   NEW PORTNAME/K
    Clears screen. PORTNAME is not implemented.
   NUMINT VAR/K,STEM/K,STEPS/N/A,XMIN/A,XMAX/A,FUNCTION/A => VALUE
    Integrate a function.
   PLOT NUMBER/N/A,NORMAL/K/S,DERIVE1/K/S,DERIVE2/K/S,DERIVE1NUM/K/S,
    DERIVE2NUM/K/S,FORCE/S
    Plot a function.
   PRINT PROMPT/S
    Prints screen.
   QUIT FORCE/S
    Quit program. With FORCE, there will be no requester.
   REQUESTFILE VAR/K,STEM/K,TITLE/K,PATH/K,FILE/K,PATTERN/K,SAVE/S => FILENAME
    Gives you a filerequester.
   REQUESTNOTIFY PROMPT/K/A,BUTTON/K
    Do not use yet.
   REQUESTNUMBER VAR/K,STEM/K,PROMPT/K,DEFAULT/K/N => NUMBER/N
    Asks the user for a number.
   REQUESTRESPONSE VAR/K,STEM/K,TITLE/K,PROMPT/K/A,BUTTON/K => RETURN/N
    Brings up an EasyRequest with TITLE as title, PROMPT as the text and
    BUTTON (e.g. "OK|WELL|CANCEL") as the gadgets. RC is 5 for the rightmost
    gadget, otherwise result is 1,2...
   REQUESTSTRING VAR/K,STEM/K,PROMPT/K,DEFAULT/K,TITLE/K => STRING
    Ask the user for a string.
   RX VAR/K,STEM/K,CONSOLE/S,ASYNC/S,COMMAND/F => RC/N,RESULT
    Start a skript.
   SAVECONST FILENAME
   SAVEFUNC FILENAME
    Save definitions to a file
   SAVEIFF FILENAME
    Save screen as IFF.
   SAVEMACRO FILENAME
    See above.
   SCREENTOBACK
   SCREENTOFRONT
    Should be clear
   SELECTMENU MENU/N/A,ITEM/N/A,SUB/N,FORCE/S
    Selects a menu. 0 is the first one. FORCE suppresses some requester.
    Do not use this command directly in a skript, because the numbers may
    change. Use the following way:
    Let's say you want to display the about-requster. That is MENU=0 ITEM=13
    in this version. Instead of SELECTMENU 0 13 use SHOWABOUT. Write a file
    "showabout.mpl" with two lines: "/* */" and "selectmenu 0 13". Copy
    this file to REXX:. If the number of the item has changed (e.g. to 14),
    you have to change only one file: "showabout.mpl". If you had use 
    SELECTMENU directly, you had to change every file which used menu 0, item 13.
   SETCOLOR PLOTCOLOR/N/K, AXISCOLOR/N/K, TEXTCOLOR/N/K,
                           AXISCOLORBACK/N/K, TEXTCOLORBACK/N/K, 
                           AXISMODE/N/K, TEXTMODE/N/K
    Change some colors and drawmodes.
   SETCONST NAME/A,DEFINITION/A
   SETFUNC NUMBER/N/A,DEFINITION/A
   SETMACRO NAME/A,DEFINITION/A
    Set new definitions.
   SETINTERVALL XAXIS/N/K,XMIN/K,XMAX/K,YAXIS/N/K,YMIN/K,YMAX/K
    Set a new intervall.
   SETNUMPRECISION PRECISION/N/A
    Sets the number of digits behind the point for NUMINT and EVALSTRING
   VERSION VAR/K,STEM/K => VERSION  
    Gives you a version string.
 
 ARexx-Macros
 ------------
  To simplify some actions, you can write (ARexx-) macros. There is one
  example:
  
  - Schar
    To plot i.e. sin(x)+a a=1,2,3 you can do the following:
    define the first function as sin(x)+a. Call Schar.mapl. You are asked 
    for the number of the function (0), the name of the constant (a), start 
    and end (1,3) and the number of steps (3). Then the three functions will 
    be plotted.


Thanks
======

 I would like to thank some people:

  - Commodore for Kickstart/Workbench 2.0 (especially gadtools.library).
  - Joern Clausen for his beta-testing and the programm's icon.
  - Michael Balzer for his ARexxBox, which made MathPlot's
    ARexx-port possible.



The END
=======

    If you have hints, questions (please  add postage for the answer),
    bug-reports or want to pay the registration fee, write me. 
    My address is at the beginning of this document.


           Have fun with my program !!

