Mathc initiation/Fichiers h : c59a6


Sommaire


Installer ce fichier dans votre répertoire de travail.

kg_3dpxy.h
/* --------------------------------- */
/* save as kg_3dpxy.h                */
/* --------------------------------- */
void G_3d_pxy(
CTRL_splot p,
  char feq[],
double (*P_f)(double x, double y),
pt2d Q,
pt2d step
)
{
FILE   *fp;
double   x;
double   y;

        fp = fopen("a_main.plt","w");

fprintf(fp," reset");
fprintf(fp,"#\n\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",
                    p.rot_x,p.rot_z,p.scale,p.scale_z);
fprintf(fp,"set xrange [%0.3f:%0.3f]\n",p.xmin,p.xmax);
fprintf(fp,"set yrange [%0.3f:%0.3f]\n",p.ymin,p.ymax);
fprintf(fp,"set zrange [%0.3f:%0.3f]\n",p.zmin,p.zmax);
fprintf(fp,"splot ");
fprintf(fp,"\"a_ka\" with line lw 6 lt 7,\\\n");
fprintf(fp,"\"a_kb\" with line lw 6 lt 7,\\\n");
fprintf(fp,"\"a_kp\" pt 20          lt 8,\\\n");
fprintf(fp,"%s",feq);

fprintf(fp,"\n\n");

  fclose(fp);

  fp = fopen("a_ka","w");
   for(y = p.ymin; y <= p.ymax; y += step.y)
        fprintf(fp," %6.3f   %6.3f   %6.3f\n", Q.x, y, ((*P_f)(Q.x,y)) );
  fclose(fp);

  fp = fopen("a_kb","w");
   for(x = p.xmin; x <= p.xmax; x += step.x)
        fprintf(fp," %6.3f   %6.3f   %6.3f\n", x, Q.y, ((*P_f)(x,Q.y)) );
  fclose(fp);
  
   fp = fopen("a_kp","w");
         fprintf(fp," %6.3f   %6.3f   %6.3f\n", 
              Q.x, Q.y, ((*P_f)(Q.x,Q.y)) );
 fclose(fp);
}
/* --------------------------------- */
/* --------------------------------- */


Déclaration des fichiers h.