* FORMAT OF GDAT FILES

To visualize curves and surfaces GTKMathplot has to calculate starting from
their equations the coordinates of the points, segments or facets which form
them.
There are situations in which you could be interested to know the coordinates
of the points forming a curve or surface. If this is the case, you can
click on the button "Evaluate & Save" of the input page after defining
a mathematical object. A file selector is shown, by means of which you can
choose the file where to save the results of the computations done by 
GTKMathplot (see section [[THE INPUT PAGE]]). The file should have extension
".gdat", that's why I will call GTKMathplot data files also gdat files.

The data files of GTKMathplot are simple ASCII text-files: you can read and 
modify them using any editor (editor = program to process text-files, like
emacs, vi, gedit, kate, jed, nano, nedit or the Notepad of Windoze).
In addition, they are written in a GNUplot compatible format. Thus, the
objects stored in a gdat file can also be visualized in GNUplot using
either the `plot` command (for curves) or `splot` (for surfaces).

To understand the contents of a gdat file and eventually to modify it,
you need to know how a gdat file should be formatted. 

In general, a gdat file contains a list of points coordinates separated
by empty lines. Every non empty line stores the coordinates of
a single point. To mark the end of a set of points referring to the
same object two empty lines are used.
A gdat file can also contain comments: a line of comment
starts with the '#' character, eventually preceded by one or more empty spaces.
Comments starting with two '#' are special, since they can be used
to activate specific drawing options or to set object captions.

The exact format of a gdat file depends on the type of the object(s)
saved in it. 

Every two-dimensional curve of a graphic corresponds to a list of couples
of floating-point values. Each of these couples is placed on its own line.
Within a couple, numbers are separated by empty spaces (tabs or blanks). 
Every couple of numbers represents a point of the curve trough its absolute 
coordinates x and y; thus, every list of couples of numbers is a list of points
of a curve.

Since there is a one-to-one correspondance between the list of the
points of a curve and the set of the values of the parameter at which
the parametric equations of the curve are evaluated, every list
of points is formed by a number of elements equal to the number of
values assigned to the parameter (which in its turn is equal to the
number of subintervals plus one).
To be precise, if the parametric equations of a two-dimensional curve 
are given by ( [1] )

                     x = x(t)

                     y = y(t),
 
where the minimum of the parameter 't' is 'a', its maximum is 'b', and 'n' 
is the number of subintervals, then the curve is described by the list:

                 x(a)                     y(a)
          x(a + (b-a)/n)           y(a + (b-a)/n)
          x(a+2*(b-a)/n)           y(a+2*(b-a)/n)
          x(a+3*(b-a)/n)           y(a+3*(b-a)/n)
                             .
                             .
                             .

         x(a+(n-1)*(b-a)/n)       y(a+(n-1)*(b-a)/n)
                 x(b)                     y(b)

At the end of the list of points representing a curve two (mandatory) 
empty lines should come in order that GTKMathplot can establish where the
description of the curve ends and the next object starts.
The only exception to this rule is the case when no other object comes after
the curve: then the list of points should be followed either by one empty line,
or by nothing at all (the file ends).

What has been told for a two-dimensional curve can be repeated for a
three-dimensional one, except that every non-empty line contains three
floating-point values separated by empty spaces, instead of two.
To be precise, if the parametric equations of a three-dimensional curve
are given by
    
                     x = x(t)

                     y = y(t)

                     z = z(t),

where the minimum of the parameter 't' is 'a', its maximum is 'b', and 'n' 
is the number of subintervals, then the curve is described by the list:     

              x(a)                 y(a)                 z(a)
       x(a + (b-a)/n)       y(a + (b-a)/n)       z(a + (b-a)/n)
       x(a+2*(b-a)/n)       y(a+2*(b-a)/n)       z(a+2*(b-a)/n)
       x(a+3*(b-a)/n)       y(a+3*(b-a)/n)       z(a+3*(b-a)/n)
                        .                     .
                        .                     .
                        .                     .

    x(a+(n-1)*(b-a)/n)    y(a+(n-1)*(b-a)/n)    z(a+(n-1)*(b-a)/n)
              x(b)                 y(b)                 z(b)


Every two-dimensional surface of a graphic corresponds to a sequence
of lists of couples of floating-point values. The couples of floating-point
values forming a list are placed each on its own line.
Within a couple, numbers are separated by empty spaces (tabs or blanks). 
Every couple of numbers represents a point of the surface
trough its absolute coordinates x and y, and each list of couples of
numbers represents a curve on the surface.
To be more precise, given the surface with parametric equations ( [1] )

                     x = x(s,t)

                     y = y(s,t),

where 's' goes from 'a' to 'b', 't' varies from 'c' to 'd', and 'n'
is the number of subintervals of 't', for every fixed value of 

       t = c, c + (d-c)/n, c + 2*(d-c)/n, ..., c+(n-1)*(d-c)/n, d

there is in the data file a list of points corresponding to the curve
with parametric equations

                     x = x(s,t)

                     y = y(s,t),       with a <= s <= b.

Each of these lists is separated from the next one by one (mandatory) 
empty line. To mark the end of a surface the last list of points
should be followed by two empty lines. The only exception to this
rule is the case when no other object comes after the surface:
then the last list should be followed either by one empty line, 
or by nothing at all (the file ends).

What has been told for a two-dimensional surface can be repeated for a
three-dimensional one, except that every non-empty line contains three
floating-point values separated by empty spaces, instead of two.
A three-dimensional surface is described indeed by a set of three
parametric equations:

                     x = x(s,t)

                     y = y(s,t)

                     z = z(s,t) .

[1] Mind that curves and surfaces defined by cartesian equations can
    always be redefined through parametric equations, see [[EXAMPLES]],
    subsection [[PARAMETRIC EQUATIONS]].
