Mathc initiation/Fichiers h : c17a2


Sommaire


Installer ce fichier dans votre répertoire de travail.


kg_3dky.h
/* --------------------------------- */
/* save as kg_3dky.h                 */
/* --------------------------------- */
void G_3dky(
CTRL_splot p,
  char feq[],
double (*P_f)(double x, double y),
double (*P_k)(double y),
double kstep
)
{
FILE   *fp = fopen("a_main.plt","w");
double a;

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

fprintf(fp,"set    samples 40\n");
fprintf(fp,"set isosamples 40\n");
fprintf(fp,"set hidden3d\n");
fprintf(fp,"set xlabel \"X axis\"\n");
fprintf(fp,"set ylabel \"Y axis\"\n");
fprintf(fp,"set zlabel \"Z axis\" offset 1, 0\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,"%s,\\\n",feq);
fprintf(fp,"\"ka\"\n");
 fclose(fp);
 
             fp = fopen("ka","w"); 
  for(a=p.ymin; a<p.ymax; a += kstep)     
     fprintf(fp," %6.3f   %6.3f   %6.3f\n",
                a,(*P_k)(a),((*P_f)(a,(*P_k)(a))));     
      fclose(fp);                                 
 
}
/* --------------------------------- */
/* --------------------------------- */


Dans ce fichier il y a les utilitaires.