Aller au contenu

Mathc initiation/Fichiers h : c47a5

Un livre de Wikilivres.


Sommaire


Installer ce fichier dans votre répertoire de travail.

kg_2dp.h
utilitaire
/* ---------------------------------- */
/* save as kg_2dp.h                   */
/* ---------------------------------- */
void G_2dp(
double xmin,
double xmax,
double ymin,
double ymax,
  char feq[],
double (*P_f)(double x, double y),
  char geq[],
double (*P_g)(double x, double y),
pt2d   p
)
{
FILE   *fp;

  fp = fopen("a_main.plt","w");

fprintf(fp,"set    samples 400\n");
fprintf(fp,"set isosamples 400\n");
fprintf(fp,"set view 1.000, 1.000, 1.000, 1.000 \n");
fprintf(fp,"set xrange [%0.3f:%0.3f]\n",xmin,xmax);
fprintf(fp,"set yrange [%0.3f:%0.3f]\n",ymin,ymax);
fprintf(fp,"set zrange [%0.3f:%0.3f]\n",-.0,+.01);
fprintf(fp,"splot ");
fprintf(fp,"%s,\\\n",feq);
fprintf(fp,"%s,\\\n",geq);
fprintf(fp,"\"a_p\" lt 7 pt 7  ps 3\n\n");
fprintf(fp,"reset");

 fclose(fp);
 
 
 fp = fopen("a_p","w"); 
       
fprintf(fp," %0.6f   %0.6f  0", p.x, p.y);

 fclose(fp);
}
/* ---------------------------------- */
/* ---------------------------------- */