home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / libs / plotlib.lha / Plot_1.lzh / Source / SuppL2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-12  |  39.5 KB  |  1,123 lines

  1. /****************************************************************
  2. *                                                                                                                                *
  3. *     Filename : SuppL2.c                                                                                    *
  4. *                                                                                                                                *
  5. *****************************************************************
  6. *                                                                                                                                *
  7. *        Comment : Allgemeine Supportfunktionen für alle                            *
  8. *                            Darstellungen.                                                                        *
  9. *                                                                                                                                *
  10. *                                Funktionen                                                        *
  11. *                            ==========                                                        *
  12. *                                                                                                                                *
  13. *            InitScFunction()        Initialisiert die Bildschirmausgabe        *
  14. *            InitPlFunction()        Initialisiert die Plotterausgabe            *
  15. *            TextLine2D()                zeichnet eine Hauptlinie in 2D                *
  16. *            TextLine3D()                zeichnet eine Hauptlinie in 3D                *
  17. *            TLinex2D()                    zeichnet eine Hauptlinie in 2D exp.        *
  18. *            TLinex3D()                    zeichnet eine Hauptlinie in 3D exp.        *
  19. *            DrawXaxis()                    zeichnet und beschriftet X-Achse            *
  20. *            DrawYaxis()                    zeichnet und beschriftet Y-Achse            *
  21. *            DrawZaxis()                    zeichnet und beschriftet Z-Achse            *
  22. *            Round()                            rundet DATA Werte zu Integer                    *
  23. *            CalcColor()                    berechnet nächsten Farbwert                        *
  24. *            CalcLSize()                    berechnet die Linienlänge                            *
  25. *            GetGraphics()                speichert die aktuellen Graphikwerte    *
  26. *            ReSetGraphics()            setzt die alten Graphikwerte                    *
  27. *            GetExp()                        Ganzzahliger Exponentwert zu 10                *
  28. *            GetExpE()                        Ganzzahliger Exponentwert zu E                *
  29. *            Exp10()                            10^x Funktion                                                    *
  30. *            PrintTextRel()            schreibt relativen Text                                *
  31. *            PrintExp()                    schreibt relativen Exponententext            *
  32. *            PrintAbs()                    schreibt absoluten Text                                *
  33. *                                                                                                                                *
  34. *                             globale Variablen                                                *
  35. *                         =================                                                *
  36. *                                                                                                                                *
  37. *            OpenGraphics                Funktionspointer für                                    *
  38. *            GetMaxColor                    alle Level 3 Funktionen                                *
  39. *            GetMaxX                            welche implementiert                                    *
  40. *            GetMaxY                            wurden. Geordnet nach                                    *
  41. *            GetFgColor                    Rückgabewert.                                                    *
  42. *            GetBackColor                Diese Funktionen werden                                *
  43. *            GetTextSize                    je nach Ausgabe auf                                        *
  44. *            FillPolyLine                die verschiedenen Geräte                            *
  45. *            CloseGraphics                initialisiert.                                                *
  46. *            SetTextSize                                                                                                *
  47. *            DrawText                                                                                                    *
  48. *            ClearGraphics                                                                                            *
  49. *            SetFgColor                                                                                                *
  50. *            SetBackColor                                                                                            *
  51. *            DrawLine                                                                                                    *
  52. *            DrawRectangle                                                                                            *
  53. *            SetFillStyle                                                                                            *
  54. *            SetLineStyle                                                                                            *
  55. *                                                                                                                                *
  56. *                Rev : V1.0                                                                                            *
  57. *                                                                                                                                *
  58. *        History : V1.0 erstellen dieses Files                            01/01/90    *
  59. *                                                                                                                                *
  60. *                Doc : Plotlibrary User's Guide                                                    *
  61. *                                                                                                                                *
  62. *             Bugs : keine bekannten                                                                        *
  63. *                                                                                                                                *
  64. *            Autor : Oesch Silvano                                                                            *
  65. *                                                                                                                                *
  66. *            Datum : 01/01/90                                                                                    *
  67. *                                                                                                                                *
  68. ****************************************************************/
  69.  
  70. /****************************************************************
  71. *                                                                                                                                *
  72. *    allgemeine Includedateien                                                                            *
  73. *                                                                                                                                *
  74. ****************************************************************/
  75.  
  76. #include <math.h>
  77.  
  78. /****************************************************************
  79. *                                                                                                                                *
  80. *    Plotlibrary Includedateien                                                                        *
  81. *                                                                                                                                *
  82. ****************************************************************/
  83.  
  84. #include "Plot.h"
  85. #include "PlotL2.h"
  86. #include "GfxL3.h"
  87. #include "PltL3.h"
  88. #include "NivL2.h"
  89. #include "DispL2.h"
  90. #include "D3L2.h"
  91. #include "SuppL2.h"
  92.  
  93. /****************************************************************
  94. *                                                                                                                                *
  95. *    Globale Variablen                                                                                            *
  96. *                                                                                                                                *
  97. ****************************************************************/
  98.  
  99. int        (*OpenGraphics)(),                        /* Funktionspointer für            */
  100.             (*GetMaxColor)(),                            /* alle Level 3 Funktionen    */
  101.             (*GetMaxX)(),                                    /* welche implementiert            */
  102.             (*GetMaxY)(),                                    /* wurden. Geordnet nach        */
  103.             (*GetFgColor)(),                            /* Rückgabewert.                        */
  104.             (*GetBackColor)(),                        /* Diese Funktionen werden    */
  105.             (*GetTextSize)(),                            /* je nach Ausgabe auf            */
  106.             (*FillPolyLine)();                        /* die verschiedenen Geräte    */
  107. void    (*CloseGraphics)(),                        /* initialisiert.                        */
  108.             (*SetTextSize)(),
  109.             (*DrawText)(),
  110.             (*ClearGraphics)(),
  111.             (*SetFgColor)(),
  112.             (*SetBackColor)(),
  113.             (*DrawLine)(),
  114.             (*DrawPolyLine)(),
  115.             (*DrawRectangle)(),
  116.             (*SetFillStyle)(),
  117.             (*SetLineStyle)();
  118.  
  119. DATA    (*xexpfct)(),                                    /* 10^ oder e^ bzw. ln oder    */
  120.             (*xlogfct)(),                                    /* log Funktion für X-Achse    */
  121.             (*yexpfct)(),                                    /* 10^ oder e^ bzw. ln oder    */
  122.             (*ylogfct)(),                                    /* log Funktion für Y-Achse    */
  123.             (*zexpfct)(),                                    /* 10^ oder e^ bzw. ln oder    */
  124.             (*zlogfct)();                                    /* log Funktion für Z-Achse    */
  125.  
  126. /****************************************************************
  127. *                                                                                                                                *
  128. *    Globale statische Variablen                                                                        *
  129. *                                                                                                                                *
  130. ****************************************************************/
  131.  
  132. static int oldfgcolor,                            /* alte Stiftfarbe                    */
  133.                      oldbackcolor;                        /* alte Hintergrundfarbe        */
  134.  
  135. /****************************************************************
  136. *                                                                                                                                *
  137. *    externe Variablen                                                                                            *
  138. *                                                                                                                                *
  139. ****************************************************************/
  140.  
  141. extern struct Plot *plot;
  142. extern int plerr;
  143.  
  144. /****************************************************************
  145. *                                                                                                                                *
  146. *    Function : InitScFunction()                                                                        *
  147. *                                                                                                                                *
  148. *****************************************************************
  149. *                                                                                                                                *
  150. *         Input : void                                                                                                *
  151. *                                                                                                                                *
  152. *        Output : void                                                                                                *
  153. *                                                                                                                                *
  154. *****************************************************************
  155. *                                                                                                                                *
  156. *     Comment : Diese Funktion initialisiert die Level 3                        *
  157. *                         Bildschirmfunktionen. Die entsprechenden                        *
  158. *                         Funktionen leiten somit ihre Ausgabe auf den                *
  159. *                         Graphikbildschirm. Das Gegenteil dieser Funktion        *
  160. *                         ist die InitPlFunction().                                                    *
  161. *                                                                                                                                *
  162. ****************************************************************/
  163.  
  164. void initscfunction()
  165. {
  166.     OpenGraphics    = ScOpenGraphics;        /* Alle Funktionen befinden    */
  167.     GetMaxColor        = ScGetMaxColor;        /* in der Datei GfxL3.c wo    */
  168.     GetMaxX                = ScGetMaxX;                /* sie für die Graphik auf    */
  169.     GetMaxY                = ScGetMaxY;                /* den verschiedenen                */
  170.     GetFgColor        = ScGetFgColor;            /* Rechnern angepasst                */
  171.     GetBackColor    = ScGetBackColor;        /* werden kann.                            */
  172.     GetTextSize        = ScGetTextSize;        /* Mit diesem vorgehen            */
  173.     CloseGraphics    = ScCloseGraphics;    /* ist es aber auch möglich    */
  174.     SetTextSize        = ScSetTextSize;        /* die Ausgabe auf ein            */
  175.     DrawText            = ScDrawText;                /* anderes Gerät umzuleiten    */
  176.     ClearGraphics    = ScClearGraphics;    /* wie auf einen Plotter.        */
  177.     SetFgColor        = ScSetFgColor;
  178.     SetBackColor    = ScSetBackColor;
  179.     DrawLine            = ScDrawLine;
  180.     DrawPolyLine    = ScDrawPolyLine;
  181.     FillPolyLine    = ScFillPolyLine;
  182.     DrawRectangle    = ScDrawRectangle;
  183.     SetFillStyle    = ScSetFillStyle;
  184.     SetLineStyle    = ScSetLineStyle;
  185. }
  186.  
  187. /****************************************************************
  188. *                                                                                                                                *
  189. *    Function : InitplFunction()                                                                        *
  190. *                                                                                                                                *
  191. *****************************************************************
  192. *                                                                                                                                *
  193. *         Input : void                                                                                                *
  194. *                                                                                                                                *
  195. *        Output : void                                                                                                *
  196. *                                                                                                                                *
  197. *****************************************************************
  198. *                                                                                                                                *
  199. *     Comment : Diese Funktion initialisiert die Level 3                        *
  200. *                         Plotfunktionen. Die entsprechenden    Funktionen            *
  201. *                         leiten somit ihre Ausgabe auf einen Plotter                *
  202. *                         welcher dem HPGL Standart entspricht. Die Ausgabe    *
  203. *                         erfolgt über eine Datei welche zu dem ent-                    *
  204. *                         sprechenden Gerät kopiert werden kann. Das                    *
  205. *                         Gegenteil dieser Funktion ist die                                    *
  206. *                         InitScFunction().                                                                    *
  207. *                                                                                                                                *
  208. ****************************************************************/
  209.  
  210. void initplfunction()
  211. {
  212.     OpenGraphics    = PlOpenGraphics;        /* Alle Funktionen befinden    */
  213.     GetMaxColor        = PlGetMaxColor;        /* in der Datei PltL3.c wo    */
  214.     GetMaxX                = PlGetMaxX;                /* sie für einen Plotter        */
  215.     GetMaxY                = PlGetMaxY;                /* die verschiedenen                */
  216.     GetFgColor        = PlGetFgColor;            /* Befehle in eine Datei        */
  217.     GetBackColor    = PlGetBackColor;        /* schreibt.                                */
  218.     GetTextSize        = PlGetTextSize;
  219.     CloseGraphics    = PlCloseGraphics;
  220.     SetTextSize        = PlSetTextSize;
  221.     DrawText            = PlDrawText;
  222.     ClearGraphics    = PlClearGraphics;
  223.     SetFgColor        = PlSetFgColor;
  224.     SetBackColor    = PlSetBackColor;
  225.     DrawLine            = PlDrawLine;
  226.     DrawPolyLine    = PlDrawPolyLine;
  227.     FillPolyLine    = PlFillPolyLine;
  228.     DrawRectangle    = PlDrawRectangle;
  229.     SetFillStyle    = PlSetFillStyle;
  230.     SetLineStyle    = PlSetLineStyle;
  231. }
  232.  
  233. /****************************************************************
  234. *                                                                                                                                *
  235. *    Function : TextLine2D()                                                                                *
  236. *                                                                                                                                *
  237. *****************************************************************
  238. *                                                                                                                                *
  239. *         Input : text,x,y,x1,y1,opt                                                                    *
  240. *                            char *text                    Beschriftungstext                            *
  241. *                            DATA *x                            Startwert (x/y)                                *
  242. *                            DATA *y                                                                                        *
  243. *                            DATA *x1                        Endwerte (x1/y1)                            *
  244. *                            DATA *y1                                                                                    *
  245. *                            int     opt                        Beschriftungsoption                        *
  246. *                                                                                                                                *
  247. *        Output : void                                                                                                *
  248. *                                                                                                                                *
  249. *****************************************************************
  250. *                                                                                                                                *
  251. *     Comment : Zeichnet und bechriftet eine Hauptlinie der ver-        *
  252. *                         schiedenen Achsen für die 2D Darstellung.                    *
  253. *                                                                                                                                *
  254. ****************************************************************/
  255.  
  256. void textline2d(text,x,y,x1,y1,opt)
  257. char *text;
  258. DATA *x,*y,*x1,*y1;
  259. int opt;
  260. {
  261.     drawgline(x,y,x1,y1);                            /* Linie zeichnen                        */
  262.     printtextrel2d(text,x,y,opt);            /* und beschrifteten                */
  263. }
  264.  
  265. /****************************************************************
  266. *                                                                                                                                *
  267. *    Function : TextLine3D()                                                                                *
  268. *                                                                                                                                *
  269. *****************************************************************
  270. *                                                                                                                                *
  271. *         Input : text,x,y,z,x1,y1,z1,opt                                                        *
  272. *                            char *text                            Beschriftungstext                    *
  273. *                            DATA *x                                    Startwert (x/y/z)                    *
  274. *                            DATA *y                                                                                        *
  275. *                            DATA *z                                                                                        *
  276. *                            DATA *x1                                Endwerte (x1/y1/z1)                *
  277. *                            DATA *y1                                                                                    *
  278. *                            DATA *z1                                                                                    *
  279. *                            int     opt                                Beschriftungsoption                *
  280. *                                                                                                                                *
  281. *        Output : void                                                                                                *
  282. *                                                                                                                                *
  283. *****************************************************************
  284. *                                                                                                                                *
  285. *     Comment : Zeichnet und bechriftet eine Hauptlinie der ver-        *
  286. *                         schiedenen Achsen für die 3D Darstellung.                    *
  287. *                                                                                                                                *
  288. ****************************************************************/
  289.  
  290. void textline3d(text,x,y,z,x1,y1,z1,opt)
  291. char *text;
  292. DATA *x,*y,*z,*x1,*y1,*z1;
  293. int opt;
  294. {
  295.     drawgline3d(x,y,z,x1,y1,z1);            /* Linie zeichnen                        */
  296.     printtextrel3d(text,x,y,z,opt);        /* und beschrifteten                */
  297. }
  298.  
  299. /****************************************************************
  300. *                                                                                                                                *
  301. *    Function : TLinex2D()                                                                                    *
  302. *                                                                                                                                *
  303. *****************************************************************
  304. *                                                                                                                                *
  305. *         Input : exp,mes,x,y,x1,y1,opt                                                            *
  306. *                            int  exp                                        Exponent                            *
  307. *                            int     mes                                        Basis                                    *
  308. *                            DATA *x                                            Startwert (x/y)                *
  309. *                            DATA *y                                                                                        *
  310. *                            DATA *x1                                        Endwerte (x1/y1)            *
  311. *                            DATA *y1                                                                                    *
  312. *                            int     opt                                        Beschriftungsoption        *
  313. *                                                                                                                                *
  314. *        Output : void                                                                                                *
  315. *                                                                                                                                *
  316. *****************************************************************
  317. *                                                                                                                                *
  318. *     Comment : Zeichnet und bechriftet eine Hauptlinie der ver-        *
  319. *                         schiedenen Achsen für die 2D exponentielle Dar-        *
  320. *                         stellung.                                                                                    *
  321. *                                                                                                                                *
  322. ****************************************************************/
  323.  
  324. int tlinex2d(exp,mes,x,y,x1,y1,opt)
  325. int exp,mes;
  326. DATA *x,*y,*x1,*y1;
  327. int opt;
  328. {
  329.     drawgline(x,y,x1,y1);                            /* Linie zeichnen und besch */
  330.     return(printexp2d(exp,mes,x,y,opt));
  331. }
  332.  
  333. /****************************************************************
  334. *                                                                                                                                *
  335. *    Function : TLinex3D()                                                                                    *
  336. *                                                                                                                                *
  337. *****************************************************************
  338. *                                                                                                                                *
  339. *         Input : exp,mes,x,y,z,x1,y1,z1,opt                                                    *
  340. *                            int  exp                                        Exponent                            *
  341. *                            int     mes                                        Basis                                    *
  342. *                            DATA *x                                            Startwert (x/y/z)            *
  343. *                            DATA *y                                                                                        *
  344. *                            DATA *z                                                                                        *
  345. *                            DATA *x1                                        Endwerte (x1/y1/z1)        *
  346. *                            DATA *y1                                                                                    *
  347. *                            DATA *z1                                                                                    *
  348. *                            int     opt                                        Beschriftungsoption        *
  349. *                                                                                                                                *
  350. *        Output : void                                                                                                *
  351. *                                                                                                                                *
  352. *****************************************************************
  353. *                                                                                                                                *
  354. *     Comment : Zeichnet und bechriftet eine Hauptlinie der ver-        *
  355. *                         schiedenen Achsen für die 3D exponentielle Dar-        *
  356. *                         stellung.                                                                                    *
  357. *                                                                                                                                *
  358. ****************************************************************/
  359.  
  360. int tlinex3d(exp,mes,x,y,z,x1,y1,z1,opt)
  361. int exp,mes;
  362. DATA *x,*y,*z,*x1,*y1,*z1;
  363. int opt;
  364. {
  365.     drawgline3d(x,y,z,x1,y1,z1);            /* Linie zeichnen und besch */
  366.     return(printexp3d(exp,mes,x,y,z,opt));
  367. }
  368.  
  369. /****************************************************************
  370. *                                                                                                                                *
  371. *    Function : drawxaxis()                                                                                *
  372. *                                                                                                                                *
  373. *****************************************************************
  374. *                                                                                                                                *
  375. *         Input : void                                                                                                *
  376. *                                                                                                                                *
  377. *        Output : void                                                                                                *
  378. *                                                                                                                                *
  379. *****************************************************************
  380. *                                                                                                                                *
  381. *     Comment : Die Achsen werden unterteilt in eine lineare und        *
  382. *                         eine log. Darstellung. Die X-, Y-, und Z-Achse            *
  383. *                         unterscheiden sich    nur in den berechneten                    *
  384. *                         Koordinaten, desshalb wird nur die X-Achse                    *
  385. *                         erklärt.                                                                                        *
  386. *                                                                                                                                *
  387. *    lineare Darstellung                                                                                        *
  388. *        berechne Anzahl Schritte                                                                        *
  389. *        berechne Grösse Mittelschritte                                                            *
  390. *        zeichne für alle Schritte                                                                        *
  391. *            Schrittwert berechnen                                                                            *
  392. *            beschrifte Stepwert                                                                                *
  393. *            zeichne für alle Mittelschritte eine Linie                                *
  394. *            zeichen eine Steplinie                                                                        *
  395. *        letzte Beschriftung anbringen                                                                *
  396. *    log. Darstellung                                                                                            *
  397. *        berechne Startexponent                                                                            *
  398. *        berechne Endexponent                                                                                *
  399. *        für alle Schritte                                                                                        *
  400. *            berechne step                                                                                            *
  401. *            beschrifte Dekade                                                                                    *
  402. *            berechne Mittelschritt                                                                        *
  403. *            zeichne für alle Mittelschritte eine Linie                                *
  404. *            zeichne eine Steplinie                                                                        *
  405. *        letzte Beschriftung anbringen                                                                *
  406. *                                                                                                                                *
  407. ****************************************************************/
  408.  
  409. void drawxaxis()
  410. {
  411.     int i,j,counts,counte;
  412.  
  413.     DATA lstep,sstep,step,lsize,gsize;
  414.     char buffer[20];
  415.  
  416.     if (plot->typ == D3)
  417.     {
  418.         lsize = calclsize(&plot->ygridmin,BSTEPSIZE,plot->ymes);
  419.         gsize = calclsize(&plot->ygridmin,BGRIDSIZE,plot->ymes);
  420.     }
  421.  
  422.     if (plot->xmes == LIN)
  423.     {
  424.         counts = round((plot->xgridmax-plot->xgridmin)/plot->xstep);
  425.         lstep = plot->xstep/LINSLSTEP;
  426.         for (i=0;i<counts;i++)
  427.         {
  428.             step = plot->xgridmin+i*plot->xstep;
  429.             sprintf(buffer,"%.4lg",step);
  430.  
  431.             if (plot->typ != D3)
  432.                 textline2d(buffer,&step,&plot->ygridmin,
  433.                                      &step,&plot->ygridmax,T_CX|T_T);
  434.             else
  435.                 textline3d(buffer,&step,&plot->ygridmin,&plot->zgridmin,
  436.                                      &step,&gsize,&plot->zgridmin,T_R|T_T);
  437.  
  438.             for (j=1;j<LINSLSTEP;j++)
  439.             {
  440.                 sstep =step+lstep*j;
  441.                 if (plot->typ != D3)
  442.                     drawsline(&sstep,&plot->ygridmin,
  443.                                         &sstep,&plot->ygridmax);
  444.                 else
  445.                     drawgline3d(&sstep,&plot->ygridmin,&plot->zgridmin,
  446.                                             &sstep,&lsize,&plot->zgridmin);
  447.             }
  448.         }
  449.         step = plot->xgridmax;
  450.         sprintf(buffer,"%.4lg",step);
  451.         if (plot->typ != D3)
  452.             textline2d(buffer,&step,&plot->ygridmin,
  453.                                  &step,&plot->ygridmax,T_CX|T_T);
  454.         else
  455.             textline3d(buffer,&step,&plot->ygridmin,&plot->zgridmin,
  456.                                  &step,&gsize,&plot->zgridmin,T_R|T_T);
  457.     }
  458.     else
  459.     {
  460.         counts = round(xlogfct(plot->xgridmin));
  461.         counte = round(xlogfct(plot->xgridmax));
  462.  
  463.         for (i=counts;i<counte;i++)
  464.         {
  465.             step = xexpfct((DATA)i);
  466.  
  467.             if (plot->typ != D3)
  468.                 tlinex2d(i,plot->xmes,&step,&plot->ygridmin,
  469.                                  &step,&plot->ygridmax,T_CX|T_T);
  470.             else
  471.                 tlinex3d(i,plot->xmes,
  472.                                  &step,&plot->ygridmin,&plot->zgridmin,
  473.                                  &step,&gsize,&plot->zgridmin,T_R|T_T);
  474.  
  475.             lstep = (xexpfct((DATA)(i+1))-step)/LOGSLSTEP;
  476.             for (j=1;j<LOGSLSTEP;j++)
  477.             {
  478.                 sstep =step+lstep*j;
  479.                 if (plot->typ != D3)
  480.                     drawsline(&sstep,&plot->ygridmin,
  481.                                         &sstep,&plot->ygridmax);
  482.                 else
  483.                     drawgline3d(&sstep,&plot->ygridmin,&plot->zgridmin,
  484.                                             &sstep,&lsize,&plot->zgridmin);
  485.             }
  486.         }
  487.         step = plot->xgridmax;
  488.         if (plot->typ != D3)
  489.             tlinex2d(i,plot->xmes,&step,&plot->ygridmin,
  490.                              &step,&plot->ygridmax,T_CX|T_T);
  491.         else
  492.             tlinex3d(i,plot->xmes,
  493.                              &step,&plot->ygridmin,&plot->zgridmin,
  494.                              &step,&gsize,&plot->zgridmin,T_R|T_T);
  495.     }
  496. }
  497.  
  498. /****************************************************************
  499. *                                                                                                                                *
  500. *    Function : drawyaxis()                                                                                *
  501. *                                                                                                                                *
  502. *****************************************************************
  503. *                                                                                                                                *
  504. *         Input : void                                                                                                *
  505. *                                                                                                                                *
  506. *        Output : int len                max. Beschriftungslänge                            *
  507. *                                                                                                                                *
  508. *****************************************************************
  509. *                                                                                                                                *
  510. *     Comment : Siehe drawxaxis                                                                        *
  511. *                                                                                                                                *
  512. ****************************************************************/
  513.  
  514. int drawyaxis()
  515. {
  516.     int len = NULL,lent,i,j,counts,counte;
  517.  
  518.     DATA lstep,sstep,step,lsize,gsize;
  519.     char buffer[20];
  520.  
  521.     if (plot->typ == D3)
  522.     {
  523.         lsize = calclsize(&plot->zgridmin,100-BSTEPSIZE,plot->zmes);
  524.         gsize = calclsize(&plot->zgridmin,100-BGRIDSIZE,plot->zmes);
  525.     }
  526.  
  527.     if (plot->ymes == LIN)
  528.     {
  529.         counts = round((plot->ygridmax-plot->ygridmin)/plot->ystep);
  530.         lstep = plot->ystep/LINSLSTEP;
  531.         for (i=0;i<counts;i++)
  532.         {
  533.             step = plot->ygridmin+i*plot->ystep;
  534.             len = max(len,sprintf(buffer,"%.4lg",step));
  535.  
  536.             if (plot->typ != D3)
  537.                 textline2d(buffer,&plot->xgridmin,&step,
  538.                                      &plot->xgridmax,&step,T_L|T_B);
  539.             else
  540.                 textline3d(buffer,&plot->xgridmin,&step,&plot->zgridmax,
  541.                                      &plot->xgridmin,&step,&gsize,T_L|T_B);
  542.  
  543.             for (j=1;j<LINSLSTEP;j++)
  544.             {
  545.                 sstep =step+lstep*j;
  546.                 if (plot->typ != D3)
  547.                     drawsline(&plot->xgridmin,&sstep,
  548.                                         &plot->xgridmax,&sstep);
  549.                 else
  550.                     drawgline3d(&plot->xgridmin,&sstep,&plot->zgridmax,
  551.                                             &plot->xgridmin,&sstep,&lsize);
  552.             }
  553.         }
  554.         step = plot->ygridmin+i*plot->ystep;
  555.         len = max(len,sprintf(buffer,"%.4lg",step));
  556.         if (plot->typ != D3)
  557.             textline2d(buffer,&plot->xgridmin,&step,
  558.                                  &plot->xgridmax,&step,T_L|T_B);
  559.         else
  560.             textline3d(buffer,&plot->xgridmin,&step,&plot->zgridmax,
  561.                                  &plot->xgridmin,&step,&gsize,T_L|T_B);
  562.     }
  563.     else
  564.     {
  565.         counts = round(ylogfct(plot->ygridmin));
  566.         counte = round(ylogfct(plot->ygridmax));
  567.  
  568.         for (i=counts;i<counte;i++)
  569.         {
  570.             step = yexpfct((DATA)i);
  571.             if (plot->typ != D3)
  572.                 lent = tlinex2d(i,plot->ymes,&plot->xgridmin,&step,
  573.                                                 &plot->xgridmax,&step,T_L|T_B);
  574.             else
  575.                 lent = tlinex3d(i,plot->ymes,
  576.                                                 &plot->xgridmin,&step,&plot->zgridmax,
  577.                                                 &plot->xgridmin,&step,&gsize,T_L|T_B);
  578.             if (len < lent)
  579.                 len = lent;
  580.             lstep = (yexpfct((DATA)(i+1))-step)/LOGSLSTEP;
  581.             for (j=1;j<LOGSLSTEP;j++)
  582.             {
  583.                 sstep =step+lstep*j;
  584.                 if (plot->typ != D3)
  585.                     drawsline(&plot->xgridmin,&sstep,
  586.                                         &plot->xgridmax,&sstep);
  587.                 else
  588.                     drawgline3d(&plot->xgridmin,&sstep,&plot->zgridmax,
  589.                                             &plot->xgridmin,&sstep,&lsize);
  590.             }
  591.         }
  592.         step = plot->ygridmax;
  593.         if (plot->typ != D3)
  594.             lent = tlinex2d(i,plot->ymes,&plot->xgridmin,&step,
  595.                                             &plot->xgridmax,&step,T_L|T_B);
  596.         else
  597.             lent = tlinex3d(i,plot->ymes,
  598.                                             &plot->xgridmin,&step,&plot->zgridmax,
  599.                                             &plot->xgridmin,&step,&gsize,T_L|T_B);
  600.     }
  601.     return(len);
  602. }
  603.  
  604. /****************************************************************
  605. *                                                                                                                                *
  606. *    Function : drawzaxis()                                                                                *
  607. *                                                                                                                                *
  608. *****************************************************************
  609. *                                                                                                                                *
  610. *         Input : void                                                                                                *
  611. *                                                                                                                                *
  612. *        Output : void                                                                                                *
  613. *                                                                                                                                *
  614. *****************************************************************
  615. *                                                                                                                                *
  616. *     Comment : Siehe drawxaxis                                                                        *
  617. *                                                                                                                                *
  618. ****************************************************************/
  619.  
  620. void drawzaxis()
  621. {
  622.     int i,j,counts,counte;
  623.  
  624.     DATA lstep,sstep,step,lsize,gsize;
  625.     char buffer[20];
  626.  
  627.     lsize = calclsize(&plot->ygridmin,BSTEPSIZE,plot->ymes);
  628.     gsize = calclsize(&plot->ygridmin,BGRIDSIZE,plot->ymes);
  629.     if (plot->zmes == LIN)
  630.     {
  631.         counts = round((plot->zgridmax-plot->zgridmin)/plot->zstep);
  632.         lstep = plot->zstep/LINSLSTEP;
  633.         for (i=0;i<counts;i++)
  634.         {
  635.             step = plot->zgridmin+i*plot->zstep;
  636.             sprintf(buffer,"%.4lg",step);
  637.             textline3d(buffer,&plot->xgridmin,&plot->ygridmin,
  638.                                  &step,&plot->xgridmin,&gsize,&step,T_L|T_T);
  639.             for (j=1;j<LINSLSTEP;j++)
  640.             {
  641.                 sstep =step+lstep*j;
  642.                 drawgline3d(&plot->xgridmin,&plot->ygridmin,&sstep,
  643.                                         &plot->xgridmin,&lsize,&sstep);
  644.             }
  645.         }
  646.         step = plot->zgridmin+i*plot->zstep;
  647.         sprintf(buffer,"%.4lg",step);
  648.         textline3d(buffer,&plot->xgridmin,&plot->ygridmin,&step,
  649.                              &plot->xgridmin,&gsize,&step,T_L|T_T);
  650.     }
  651.     else
  652.     {
  653.         counts = round(zlogfct(plot->zgridmin));
  654.         counte = round(zlogfct(plot->zgridmax));
  655.  
  656.         for (i=counts;i<counte;i++)
  657.         {
  658.             step = zexpfct((DATA)i);
  659.             tlinex3d(i,plot->zmes,
  660.                              &plot->xgridmin,&plot->ygridmin,&step,
  661.                              &plot->xgridmin,&gsize,&step,T_L|T_T);
  662.             lstep = (zexpfct((DATA)(i+1))-step)/LOGSLSTEP;
  663.             for (j=1;j<LOGSLSTEP;j++)
  664.             {
  665.                 sstep =step+lstep*j;
  666.                 drawgline3d(&plot->xgridmin,&plot->ygridmin,&sstep,
  667.                                         &plot->xgridmin,&lsize,&sstep);
  668.             }
  669.         }
  670.         step = plot->zgridmax;
  671.         tlinex3d(i,plot->zmes,
  672.                          &plot->xgridmin,&plot->ygridmin,&step,
  673.                          &plot->xgridmin,&gsize,&step,T_L|T_T);
  674.     }
  675. }
  676.  
  677. /****************************************************************
  678. *                                                                                                                                *
  679. *    Function : round()                                                                                        *
  680. *                                                                                                                                *
  681. *****************************************************************
  682. *                                                                                                                                *
  683. *         Input : value                                                                                            *
  684. *                            DATA value                    Zahlenwert                                        *
  685. *                                                                                                                                *
  686. *        Output : newval                                                                                            *
  687. *                            int newval                    gerundeter Zahlenwert                    *
  688. *                                                                                                                                *
  689. *****************************************************************
  690. *                                                                                                                                *
  691. *     Comment : Diese Funktion rundet einen Floatwert und                    *
  692. *                         konvertiert diesen zu einem Integerwert.                        *
  693. *                                                                                                                                *
  694. ****************************************************************/
  695.  
  696. int round(val)
  697. DATA val;
  698. {
  699.     if (val < 0)                                            /* kleiner als NULL                    */
  700.         val -= 0.5;                                            /* dann subtrahieren                */
  701.     else
  702.         val += 0.5;                                            /* sonst addieren                        */
  703.     return((int)val);                                    /* zurück mit integer                */
  704. }
  705.  
  706. /****************************************************************
  707. *                                                                                                                                *
  708. *    Function : calccolor()                                                                                *
  709. *                                                                                                                                *
  710. *****************************************************************
  711. *                                                                                                                                *
  712. *         Input : color                                                                                            *
  713. *                            int color                        Farbwert                                            *
  714. *                                                                                                                                *
  715. *        Output : void                                                                                                *
  716. *                                                                                                                                *
  717. *****************************************************************
  718. *                                                                                                                                *
  719. *     Comment : Diese Funktion setzt die vom User gesetzte Farbe        *
  720. *                         wenn sie im Bereich der max. Farben ist. Ansonsten    *
  721. *                         wird die nächste freie Farbe gesetzt. Wenn keine        *
  722. *                         freien Farben mehr verfügbar sind, wird wieder von    *
  723. *                         vorne begonnen. Die globale statische Variable            *
  724. *                         curcol ist die nächste freie Farbe.                                *
  725. *                                                                                                                                *
  726. ****************************************************************/
  727.  
  728. void calccolor(color)
  729. int color;
  730. {
  731.     if (color != COLDET)                            /* User definierte Farbe        */
  732.         if (color > plot->maxcol)                /* ist sie im Bereich                */
  733.             calccolor(COLDET);                        /* setzte nächste Farbe         */
  734.         else                                                        /* Ja                                                */
  735.         {
  736.             SetFgColor(color);                        /* setze Farbe                            */
  737.             SetLineStyle(SOL_LINE);                /* und ganze Linie                    */
  738.         }
  739.     else                                                            /* keine User Farbe                    */
  740.     {
  741.         if (plot->col > plot->maxcol)        /* nächste Farbe im Bereich    */
  742.             plot->col = STARTCOL;                    /* wenn nicht, von vorne        */
  743.         calccolor(plot->col++);                    /* setzte nächste Farbe         */
  744.     }
  745. }
  746.  
  747. /****************************************************************
  748. *                                                                                                                                *
  749. *    Function : getgraphics()                                                                            *
  750. *                                                                                                                                *
  751. *****************************************************************
  752. *                                                                                                                                *
  753. *         Input : void                                                                                                *
  754. *                                                                                                                                *
  755. *        Output : void                                                                                                *
  756. *                                                                                                                                *
  757. *****************************************************************
  758. *                                                                                                                                *
  759. *     Comment : Diese Routine holt die aktuellen Graphikwerte            *
  760. *                         welche zum Zeitpunk eingestellt sind.                            *
  761. *                         Die folgenden Werte werden in statischen                        *
  762. *                         globalen Variabeln gespeichert:                                        *
  763. *                                                                                                                                *
  764. *                                    1.    Stiftfarbe                                                                *
  765. *                                    2.    Hintergrund                                                                *
  766. *                                                                                                                                *
  767. ****************************************************************/
  768.  
  769. void getgraphics()
  770. {
  771.     oldfgcolor = GetFgColor();                /* hole Stift                                */
  772.     oldbackcolor = GetBackColor();        /* hole Hintergrund                    */
  773. }
  774.  
  775. /****************************************************************
  776. *                                                                                                                                *
  777. *    Function : resetgraphics()                                                                        *
  778. *                                                                                                                                *
  779. *****************************************************************
  780. *                                                                                                                                *
  781. *         Input : void                                                                                                *
  782. *                                                                                                                                *
  783. *        Output : void                                                                                                *
  784. *                                                                                                                                *
  785. *****************************************************************
  786. *                                                                                                                                *
  787. *     Comment : Diese Funktion ist das Gegenstück von getgraphics.    *
  788. *                         Die gespeicherten Daten des Usergraphik werden         *
  789. *                         neu gesetzt, sodass keine Veränderung stattfinden    *
  790. *                         sollte.                                                                                        *
  791. *                                                                                                                                *
  792. ****************************************************************/
  793.  
  794. void resetgraphics()
  795. {
  796.     SetFgColor(oldfgcolor);                        /* setzte alte Stiftfarbe        */
  797.     SetBackColor(oldbackcolor);                /* setzte alter Hintergrund    */
  798. }
  799.  
  800. /****************************************************************
  801. *                                                                                                                                *
  802. *    Function : getexp()                                                                                        *
  803. *                                                                                                                                *
  804. *****************************************************************
  805. *                                                                                                                                *
  806. *         Input : DATA val                Zahl                                                                *
  807. *                                                                                                                                *
  808. *        Output : double exp            Exponent zur Basis 10                                *
  809. *                                                                                                                                *
  810. *****************************************************************
  811. *                                                                                                                                *
  812. *     Comment : Diese Funktion berechnet den ganzzahligen                    *
  813. *                         Exponenten einer Zahl zur Basis 10.                                *
  814. *                                                                                                                                *
  815. ****************************************************************/
  816.  
  817. double getexp(val)
  818. DATA val;
  819. {
  820.     val = fabs(val);                                    /* nur pos. Werte erlaubt        */
  821.     return(floor(log10(val)));                /* gerundeter Exponent            */
  822. }
  823.  
  824. /****************************************************************
  825. *                                                                                                                                *
  826. *    Function : getexpe()                                                                                    *
  827. *                                                                                                                                *
  828. *****************************************************************
  829. *                                                                                                                                *
  830. *         Input : DATA val                Wert                                                                *
  831. *                                                                                                                                *
  832. *        Output : double exp            Exponet zur Basis e                                    *
  833. *                                                                                                                                *
  834. *****************************************************************
  835. *                                                                                                                                *
  836. *     Comment : Diese Funktion berechnet den ganzzahligen                    *
  837. *                         Exponenten einer Zahl zur Basis e.                                    *
  838. *                                                                                                                                *
  839. ****************************************************************/
  840.  
  841. double getexpe(val)
  842. DATA val;
  843. {
  844.     val = fabs(val);                                    /* nur pos Werte erlaubt        */
  845.     return(floor(log(val)));                    /* gerundeter Exponent            */
  846. }
  847.  
  848. /****************************************************************
  849. *                                                                                                                                *
  850. *    Function : exp10()                                                                                        *
  851. *                                                                                                                                *
  852. *****************************************************************
  853. *                                                                                                                                *
  854. *         Input : exponent                                                                                        *
  855. *                            DATA exponent                Exponent des Wertes                        *
  856. *                                                                                                                                *
  857. *        Output : value                                                                                            *
  858. *                            DATA value                    Werte mit 10^exponent                    *
  859. *                                                                                                                                *
  860. *****************************************************************
  861. *                                                                                                                                *
  862. *     Comment : Diese Funktion definiert die power Funktion mit        *
  863. *                         einer Basis von 10. Da nicht alle Compiler die            *
  864. *                         pow10() Funktion unterstützten, wurde eine eigene    *
  865. *                         Funktion generiert.                                                                *
  866. *                                                                                                                                *
  867. ****************************************************************/
  868.  
  869. DATA exp10(exponent)
  870. DATA exponent;
  871. {
  872.     return(pow(10.0,exponent));                /* klar, oder nicht ?                */
  873. }
  874.  
  875. /****************************************************************
  876. *                                                                                                                                *
  877. *    Function : printtextrel()                                                                            *
  878. *                                                                                                                                *
  879. *****************************************************************
  880. *                                                                                                                                *
  881. *         Input : buffer,x,y,xjust,yjust                                                            *
  882. *                            char *buffer            Text                                                        *
  883. *                            DATA  x                        rel x Koordinate                                *
  884. *                            DATA  y                        rel y Koordinate                                *
  885. *                            DATA  z                        rel z Koordinate                                *
  886. *                            int     just                    Ausrichtung                                            *
  887. *                                                                                                                                *
  888. *        Output : void                                                                                                *
  889. *                                                                                                                                *
  890. *****************************************************************
  891. *                                                                                                                                *
  892. *     Comment : Diese Funktion beschriftet eine relative                        *
  893. *                         Koordinate mit ihrem Wert. Die x, y und z Werte        *
  894. *                         werden transformiert und entsprechend der                     *
  895. *                         Ausrichtung verschoben.                                                        *
  896. *                                                                                                                                *
  897. *                         Definiert sind für x Richtung:                                            *
  898. *                                                                                                                                *
  899. *                            T_CX,T_L,T_R                                                                            *
  900. *                                                                                                                                *
  901. *                         Definiert sind für y Richtung:                                            *
  902. *                                                                                                                                *
  903. *                            T_CY,T_T,T_B                                                                            *
  904. *                                                                                                                                *
  905. ****************************************************************/
  906.  
  907. void printtextrel(buffer,x,y,z,just)
  908. char    *buffer;
  909. DATA    *x,
  910.             *y,
  911.             *z;
  912. int        just;
  913. {
  914.     int xn,yn;                                                /* Transformationsvar.            */
  915.  
  916.     if (plot->typ != D3)
  917.         trans2d(x,y,&xn,&yn);                        /* transformiere 2d                    */
  918.     else
  919.         trans3d(x,y,z,&xn,&yn);                    /* transformiere 3d                    */
  920.     printtextabs(buffer,xn,yn,just);
  921.                                                                         /* und schreibe absolut            */
  922. }
  923.  
  924. /****************************************************************
  925. *                                                                                                                                *
  926. *    Function : printexp()                                                                                    *
  927. *                                                                                                                                *
  928. *****************************************************************
  929. *                                                                                                                                *
  930. *         Input : exp,base,x,y,xjust,yjust                                                        *
  931. *                            int     exp                    exponent                                                *
  932. *                            int        base                basis                                                        *
  933. *                            DATA  *x                    rel. x Koordinate                                *
  934. *                            DATA  *y                    rel. y Koordinate                                *
  935. *                            DATA  *z                    rel. z Koordinate                                *
  936. *                            int        just                Ausrichtung                                            *
  937. *                                                                                                                                *
  938. *        Output : int len                        länge des Textes                                *
  939. *                                                                                                                                *
  940. *****************************************************************
  941. *                                                                                                                                *
  942. *     Comment : Diese Funktion zeichnet die Exponentenbeschriftung    *
  943. *                         auf den Bildschirm. Es können auch hier die                *
  944. *                         Ausrichtungsfaktoren verwendet werden.                            *
  945. *                                                                                                                                *
  946. *                         Definiert sind für x Richtung:                                            *
  947. *                                                                                                                                *
  948. *                            T_CX,T_L,T_R                                                                            *
  949. *                                                                                                                                *
  950. *                         Definiert sind für y Richtung:                                            *
  951. *                                                                                                                                *
  952. *                            T_CY,T_T,T_B                                                                                *
  953. *                                                                                                                                *
  954. ****************************************************************/
  955.  
  956. int printexp(exp,base,xo,yo,zo,just)
  957. int     exp,
  958.             base;
  959. DATA    *xo,
  960.             *yo,
  961.             *zo;
  962. int        just;
  963. {
  964.     int x,y,baselen,len;
  965.     char buffer [10];                                    /* konvert. Buffer                    */
  966.     char *expo[] =                                        /* Basistext                                */
  967.     {
  968.         "10",
  969.         "e"
  970.     };
  971.  
  972.     if (plot->typ != D3)
  973.         trans2d(xo,yo,&x,&y);                        /* konvertiere x und y            */
  974.     else
  975.         trans3d(xo,yo,zo,&x,&y);                /* konvertiere x ,y und z        */
  976.     (void)sprintf(buffer,"%d",exp);        /* Welcher Exponent in char    */
  977.     baselen = strlen(expo[base-2]);        /* Basislänge                                */
  978.     len = baselen+strlen(buffer);            /* gesammte Länge                        */
  979.  
  980.     switch (just & (T_L|T_CX|T_R))        /* x Ausrichtung                        */
  981.     {
  982.         case T_CX:
  983.             x = x-len*plot->xht;                    /* nach links um die hälfte    */
  984.             break;
  985.         case T_L:
  986.             x = x-len*plot->xtext-plot->xht;
  987.             break;                                                /* alles nach links                    */
  988.         case T_R:
  989.             x = x+plot->xht;                            /* rechts um halben char.        */
  990.             break;
  991.     }
  992.  
  993.     switch (just & (T_T|T_CY|T_B))        /* y Ausrichtung                        */
  994.     {
  995.         case T_T:
  996.             y = y+2*plot->ytext;                    /* nach unten um 1 Zeile        */
  997.             break;
  998.         case T_CY:
  999.             y = y+plot->yht;                            /* 1/2 Zeile nach unten            */
  1000.             break;
  1001.         case T_B:
  1002.             break;
  1003.     }
  1004.     DrawText(x,y,expo[base-2]);
  1005.     DrawText(x+baselen*plot->xtext,y-plot->yht,buffer);
  1006.     return(len);
  1007. }
  1008.  
  1009. /****************************************************************
  1010. *                                                                                                                                *
  1011. *    Function : printabs()                                                                                    *
  1012. *                                                                                                                                *
  1013. *****************************************************************
  1014. *                                                                                                                                *
  1015. *         Input : buffer,x,y,xjust,yjust                                                            *
  1016. *                            char *buffer            Text                                                        *
  1017. *                            int  x                        x Koordinate                                        *
  1018. *                            int  y                        y Koordinate                                        *
  1019. *                            int     just                    Ausrichtung                                            *
  1020. *                                                                                                                                *
  1021. *        Output : void                                                                                                *
  1022. *                                                                                                                                *
  1023. *****************************************************************
  1024. *                                                                                                                                *
  1025. *     Comment : Schreibt einen Text an die Koordinatenpunkt (x,y).    *
  1026. *                         Mit den Ausrichtungen wird der eff. Startpunkt            *
  1027. *                         berechnet.                                                                                    *
  1028. *                                                                                                                                *
  1029. *                         Definiert sind für x Richtung:                                            *
  1030. *                                                                                                                                *
  1031. *                            T_CX,T_L,T_R                                                                            *
  1032. *                                                                                                                                *
  1033. *                         Definiert sind für y Richtung:                                            *
  1034. *                                                                                                                                *
  1035. *                            T_CY,T_T,T_B                                                                            *
  1036. *                                                                                                                                *
  1037. ****************************************************************/
  1038.  
  1039. void printtextabs(buffer,x,y,just)
  1040. char    *buffer;
  1041. int        x,
  1042.             y,
  1043.             just;
  1044. {
  1045.     switch (just & (T_L|T_CX|T_R))        /* x Ausrichtung                        */
  1046.     {
  1047.         case T_CX:
  1048.             x = x-strlen(buffer)*plot->xht;
  1049.                                                                         /* nach links um die hälfte    */
  1050.             break;
  1051.         case T_L:
  1052.             x = x-strlen(buffer)*plot->xtext-plot->xht;
  1053.             break;                                                /* alles nach links                    */
  1054.         case T_R:
  1055.             x = x+plot->xht;                            /* rechts um halben char.        */
  1056.             break;
  1057.     }
  1058.     switch (just & (T_T|T_CY|T_B))        /* y Ausrichtung                        */
  1059.     {
  1060.         case T_T:
  1061.             y = y+plot->ylt;                            /* nach unten um 3/2 Zeilen    */
  1062.             break;
  1063.         case T_CY:
  1064.             y = y+plot->yht;                            /* 1/2 Zeile nach unten            */
  1065.             break;
  1066.         case T_B:
  1067.             break;
  1068.     }
  1069.     DrawText(x,y,buffer);                            /* Zeichne Text                            */
  1070. }
  1071.  
  1072. /****************************************************************
  1073. *                                                                                                                                *
  1074. *    Function : calclsize()                                                                                *
  1075. *                                                                                                                                *
  1076. *****************************************************************
  1077. *                                                                                                                                *
  1078. *         Input : min,size,mes                                                                                *
  1079. *                            DATA *min            Zeiger auf minimalen Gitterwert            *
  1080. *                            int size            Länge in % der Linie                                *
  1081. *                            int mes                Masseinheit                                                    *
  1082. *                                                                                                                                *
  1083. *        Output : DATA    val                Endwert der Linie                                        *
  1084. *                                                                                                                                *
  1085. *****************************************************************
  1086. *                                                                                                                                *
  1087. *     Comment : Diese Funktion berechnet den Endwert eine Strecke    *
  1088. *                         deren Länge in Prozenten angegeben wird. Diese            *
  1089. *                         Funktion wird nur für das Gitter und auch nur bei    *
  1090. *                         3D Darstellung benötigt.                                                        *
  1091. *                                                                                                                                *
  1092. ****************************************************************/
  1093.  
  1094. static DATA calclsize(min,size,mes)
  1095. DATA *min;
  1096. int size,
  1097.         mes;
  1098. {
  1099.  
  1100.     DATA a,b;                                                    /* temp. Speicher                        */
  1101.  
  1102.     if (mes == LIN)                                        /* linearer Masstab                    */
  1103.     {
  1104.         a = *min;                                                /* minimum und maximum            */
  1105.         b = *(min+1);                                        /* zuweisen                                    */
  1106.         return(a+(b-a)*size/100);                /* Endpunkt berechnen                */
  1107.     }
  1108.     else if (mes == LOG)                            /* log. Masstab                            */
  1109.     {
  1110.         a = log10(*min);                                /* minimum und maximum            */
  1111.         b = log10(*(min+1));                        /* zuweisen                                    */
  1112.         return(exp10(a+(b-a)*size/100));
  1113.                                                                         /* Endpunkt berechnen                */
  1114.     }
  1115.     else                                                            /* nat. log. Masstab                */
  1116.     {
  1117.         a = log(*min);                                    /* minimum und maximum            */
  1118.         b = log(*(min+1));                            /* zuweisen                                    */
  1119.         return(exp(a+(b-a)*size/100));    /* Endpunkt berechnen                */
  1120.     }
  1121. }
  1122.  
  1123.