Sommaire


Installer ce fichier dans votre répertoire de travail.

G_Curve_2d
/* --------------------------------- */
/* save as kg_curv2d.h               */
/* --------------------------------- */
void G_Curve_2d(
CTRL_splot p,
double (*P_f)(double t),
double (*P_g)(double t),
tvalue t
)
{
FILE   *fp = fopen("a_main.plt","w");
 
  fprintf(fp," reset\n"
           " set size ratio -1\n"
           " set zeroaxis lt 8\n"
           " set grid\n\n"
           " plot [%0.3f:%0.3f] [%0.3f:%0.3f]\\\n" 
           " \"a_curve\" with linespoints lt 6,\\\n" 
           " \"a_point\" with linesp      lt 7 ps 3\n",
             p.xmin,p.xmax,p.ymin,p.ymax);
  fclose(fp);

  fp = fopen("a_point","w");
  fprintf(fp,"  %6.5f  %6.5f  \n",
           (*P_f)(t.value),(*P_g)(t.value));
  fclose(fp);
  
  fp = fopen("a_curve","w");
  for(t.value=t.min; t.value<t.max; t.value+=t.step)
      fprintf(fp," %6.3f  %6.3f\n",
             (*P_f)(t.value),(*P_g)(t.value));   
  fclose(fp);
}
/* --------------------------------- */
/* --------------------------------- */


Le fichier a_main.plt :
 reset
 set size ratio -1
 set zeroaxis lt 8
 set grid

 plot [-2.000:2.000] [-1.000:1.000]\
 "a_curve" with linespoints lt 6,\
 "a_point" with linesp      lt 7 ps 3