Mathc initiation/Fichiers h : c59a2
Installer ce fichier dans votre répertoire de travail.
kg_3dpxy.h |
---|
/* --------------------------------- */
/* save as kg_3dpxy.h */
/* --------------------------------- */
void G_3d_pxy(
CTRL_splot w,
char feq[],
double (*P_f)(double x, double y),
pt2d p,
pt2d step
)
{
double x;
double y;
FILE *fp = fopen("a_main.plt","w");
fprintf(fp," reset\n");
fprintf(fp,"set xlabel \"<x>\"\n");
fprintf(fp,"set ylabel \"<y>\"\n");
fprintf(fp,"set zlabel \"<z>\"\n");
fprintf(fp,"set samples 40\n");
fprintf(fp,"set isosamples 40\n");
fprintf(fp,"set view %0.3f, %0.3f, %0.3f, %0.3f \n",
w.rot_x,w.rot_z,w.scale,w.scale_z);
fprintf(fp,"set xrange [%0.3f:%0.3f]\n",w.xmin,w.xmax);
fprintf(fp,"set yrange [%0.3f:%0.3f]\n",w.ymin,w.ymax);
fprintf(fp,"set zrange [%0.3f:%0.3f]\n",w.zmin,w.zmax);
fprintf(fp,"splot ");
fprintf(fp,"\"a_ka\" with line lw 6,\\\n");
fprintf(fp,"\"a_kb\" with line lw 6,\\\n");
fprintf(fp,"%s\n\n",feq);
fclose(fp);
fp = fopen("a_ka","w");
for(y = w.ymin; y <= w.ymax; y += step.y)
fprintf(fp," %6.3f %6.3f %6.3f\n", p.x, y, ((*P_f)(p.x,y)) );
fclose(fp);
fp = fopen("a_kb","w");
for(x = w.xmin; x <= w.xmax; x += step.x)
fprintf(fp," %6.3f %6.3f %6.3f\n", x, p.y, ((*P_f)(x,p.y)) );
fclose(fp);
printf(" ... load \"a_main.plt\" ... with gnuplot.\n\n");
}
/* --------------------------------- */
/* --------------------------------- */
Déclaration des fichiers h.