Mathc initiation/c34a1
Apparence
Installer ce fichier dans votre répertoire de travail.
kg_f_ab.h |
---|
/* --------------------------------- */
/* save as kg_f_ab.h */
/* --------------------------------- */
void G_f_ab(
CTRL_splot w,
double ax,
double bx,
char veq[],
double (*P_v)(double x)
)
{
FILE *fp = fopen("a_main.plt","w");
fprintf(fp," set zeroaxis lt 8\n"
" set grid\n\n"
" plot [%0.3f:%0.3f] [%0.3f:%0.3f]\\\n"
" %s with line lt 7 lw 2,\\\n"
" \"ab\" with line lt 7 lw 2 \n"
" reset\n\n",
w.xmin,w.xmax,w.ymin,w.ymax,
veq);
fclose(fp);
fp = fopen("ab", "w");
fprintf(fp," %0.6f %0.6f \n", ax, ((*P_v)(ax)));
fprintf(fp," %0.6f %0.6f\n\n", ax, 0.0);
fprintf(fp," %0.6f %0.6f \n", bx, ((*P_v)(bx)));
fprintf(fp," %0.6f %0.6f \n", bx, 0.0);
fclose(fp);
printf(" ... load \"a_main.plt\" ... with gnuplot.\n\n");
}
/* --------------------------------- */
/* --------------------------------- */