
(*********************************************************************
 *
 *  :Program.    GraphDemo.mod
 *  :Author.     Gary Struhlik
 *  :shortcut.   [gs]
 *  :Version.    1.0
 *  :Date.       10.09.89
 *  :Copyright.  PD
 *  :Language.   Modula-II
 *  :Translator. M2Amiga
 *  :Contents.   Testroutine für das Modul "GraphicLib"
 *
 *********************************************************************)

MODULE GraphDemo;


FROM MathLib0 IMPORT sin,exp;
FROM GraphicLib IMPORT GraphOn, GraphOff,  InitVector, graph1,
                       sx, sy, vector, gmove;
                       
VAR
	a,x1,y1 : REAL;
BEGIN                         (* Demonstration verschieden großer Achsen- *)
                              (* kreuze                                   *)
	GraphOn("Fkt.plot"); InitVector;
        
        graph1( 1,-9.0, 11.0, 5, -0.2, 1.0, 5, 0.67, 0.98, 0.55, 0.91,
               'sin(x)/x','-> x','-> y');

        a:=-9.0; gmove( sx(-9.0), sy(sin(-9.0)/(-9.0)));
        WHILE a<=11.0 DO
          x1:=a;
          IF a <> 0.0 THEN y1:=sin(a)/a END;
          vector( sx(x1), sy(y1) );
          a:=a+0.2
        END;

        graph1(2, 0.0, 20.0, 5, -2.0, 2.0, 5, 0.15, 0.48, 0.15, 0.48,
               'sin(x)*exp(-x/5)','-> x-Werte','-> y-Werte');

        a:=0.0; gmove( sx(0.0), sy(0.0));
        WHILE a<=20.0 DO
          x1:=a;
          y1:=sin(a)*exp(-a/5.0);
          vector( sx(x1), sy(y1) );
          a:=a+0.2
        END;

        
        graph1(1, 0.0, 20.0, 5, -1.0, 1.0, 5, 0.65, 0.97, 0.13, 0.41,
               '','','');

         a:=0.0; gmove( sx(0.0), sy(0.0));
        WHILE a<=20.0 DO
          x1:=a;
          y1:=sin(a);
          vector( sx(x1), sy(y1) );
          a:=a+0.2
        END;

        graph1(2, -45.0, 45.0, 5, -2.0, 2.0, 5, 0.12, 0.5, 0.65, 0.95,
               '','','');

        a:=-45.0; gmove( sx(-45.0), sy(sin(-45.0)+sin(1.1*(-45.0))));
        WHILE a<=45.0 DO
          x1:=a;
          y1:=sin(a)+sin(a*1.1);
          vector( sx(x1), sy(y1) );
          a:=a+0.8
        END;
        
        GraphOff
 END GraphDemo.
