Mathc initiation/a344

Un livre de Wikilivres.


Sommaire


Installer ce fichier dans votre répertoire de travail.

g_tanxy.h
/* ---------------------------------- */
/* save as g_tanxy.h                  */
/* ---------------------------------- */
void G_Tan_xy(
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 3,\\\n"
           " %0.6f*x %+0.6f  with line   lt 6 lw 3,\\\n" 
           " \"a_P\"         with linesp lt 7 ps 2,\\\n"  
           " \"a_A\"         with linesp lt 7 ps 2,\\\n" 
           " \"a_B\"         with linesp lt 7 ps 2 \\\n",
             w.xmin,w.xmax,w.ymin,w.ymax,
             feq,
             a,b);
 fclose(fp);
 
 a = ((*P_f)(c));
 
         fp = fopen("a_P","w");
 fprintf(fp," %0.6f   %0.6f", c, a);
  fclose(fp);
  
 a = c - ((*P_f)(c)) / ((*PDf)(c));
 
         fp = fopen("a_A","w");
 fprintf(fp," %0.6f   0.",  a);
  fclose(fp);

 a = ((*P_f)(c))- (((*PDf)(c) )*c);
 
        fp = fopen("a_B","w");
 fprintf(fp," 0.   %0.6f",  a);
  fclose(fp);
}
/* ---------------------------------- */
/* ---------------------------------- */

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