Mathc initiation/a345

Un livre de Wikilivres.


Sommaire


Installer ce fichier dans votre répertoire de travail.

g_tanpy.h
/* ---------------------------------- */
/* save as g_tanpy.h                  */
/* ---------------------------------- */
void G_TanPy(
CTRL_splot w,
double   c,
double (*P_f)(double x),
  char   feq[],
double (*PDf)(double x)
)
{
double a = ((*PDf)(c));
double b = (-((*PDf)(c))* c + ((*P_f)(c)));

FILE   *fp = fopen("a_main.plt","w");
        
fprintf(fp," set zeroaxis lt 8\n"
           " set grid\n\n"
//           " set size ratio -1\n"
           " plot [%0.3f:%0.3f] [%0.3f:%0.3f]\\\n"
           " %s             with line   lt 6 lw 2,\\\n"
           " %0.6f*x %+0.6f with line   lt 6 lw 2,\\\n" 
           " \"a_p2yaxi\"   with linesp lt 7 lw 4 ps 2  \\\n",
             w.xmin,w.xmax,w.ymin,w.ymax,
             feq,
             a,b);
  fclose(fp);
 
         fp = fopen("a_p2yaxi","w");
 fprintf(fp," %0.6f   %0.6f\n", c, ((*P_f)(c)));
 fprintf(fp," 0.  %0.6f", ((*P_f)(c))-(((*PDf)(c))*c));
  fclose(fp);

}
/* ---------------------------------- */
/* ---------------------------------- */

Dans ce fichier il y a la déclaration des fichiers h.