Mathc initiation/Fichiers h : c60fc
Installer ce fichier dans votre répertoire de travail.
kgn_c.h |
---|
/* --------------------------------- */
/* save as kgn_c.h */
/* --------------------------------- */
void eq_Normal(
double (*P_f) (double t),
double (*P_g) (double t),
double (*PDgDf)(double t),
double t
)
{
double a = -1./ (*PDgDf)(t);
double b = -1./(-(*PDgDf)(t))*(*P_f)(t)+(*P_g)(t);
printf(" %0.3f*x %+0.3f", a, b);
}
/* --------------------------------- */
void G_Normal_Lx(
CTRL_splot w,
double (*P_f) (double t),
double (*P_g) (double t),
double (*PDgDf)(double t),
tvalue t
)
{
double a = -1./ (*PDgDf)(t.value);
double b = -1./(-(*PDgDf)(t.value))*(*P_f)(t.value)+(*P_g)(t.value);
FILE *fp = fopen("a_main.plt","w");
fprintf(fp," reset\n"
" set size ratio -1\n"
" set zeroaxis lt 8\n"
" plot [%0.3f:%0.3f] [%0.3f:%0.3f]\\\n"
" \"a_curve\" with line lt 6 lw 3,\\\n"
" %0.6f*x %+0.6f,\\\n"
" \"axP\" with linesp lt 7 lw 3\n",
w.xmin,w.xmax,w.ymin,w.ymax,
a,b);
fclose(fp);
fp = fopen("axP","w");
fprintf(fp," %0.6f %0.6f\n", (*P_f)(t.value), (*P_g)(t.value));
fprintf(fp," %0.6f 0. \n",
(*P_g)(t.value)*(*PDgDf)(t.value)+(*P_f)(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.6f %6.6f\n",(*P_f)(t.value),(*P_g)(t.value));
fclose(fp);
}
/* --------------------------------- */
/* --------------------------------- */