Sommaire


Installer ce fichier dans votre répertoire de travail.

kg_polafg.h
/* --------------------------------- */
/* save as kg_polafg.h               */
/* --------------------------------- */
void G_polar_areag(
CTRL_splot w,
double (*P_f)(double k),
double (*P_g)(double k),
tvalue t,
double sector
)
{
FILE *fp = fopen("a_main.plt","w");

 fprintf(fp," reset\n"
            " set size ratio -1\n"
            " set polar\n" 
            " set grid polar lt 3\n\n"
            " plot [%0.3f:%0.3f] [%0.3f:%0.3f] [%0.3f:%0.3f]\\\n"
            " \"curvef\" with lines lt 7 lw 3,\\\n"
            " \"curveg\" with lines lt 6 lw 3,\\\n"
            " \"sector\" with lines lt 1 lw 3\n",
              t.min,t.max,  
              w.xmin,w.xmax,w.ymin,w.ymax);
 fclose(fp);


 fp = fopen("curvef","w");
 for(t.value=t.min; t.value<=t.max; t.value+=t.step)
     fprintf(fp," %6.3f   %6.3f\n",t.value,(*P_f)(t.value));
     
 fprintf(fp," %6.3f   %6.3f\n",t.max,(*P_f)(t.max));
 fclose(fp);


 fp = fopen("curveg","w");
 for(t.value=t.min; t.value<=t.max; t.value+=t.step)
      fprintf(fp," %6.3f   %6.3f\n",t.value,(*P_g)(t.value));
      
 fprintf(fp," %6.3f   %6.3f\n",t.max,(*P_g)(t.max));
 fclose(fp);


 fp = fopen("sector","w");
 fprintf(fp,"  %6.3f   %6.3f \n %6.3f   %6.3f \n\n",
            sector,(*P_f)(sector),0.,0.);
 fprintf(fp,"  %6.3f   %6.3f \n %6.3f   %6.3f \n",
            sector+2.*t.step,(*P_f)(sector + 2.*t.step),
             0.,0.);
 fclose(fp);
}
/* --------------------------------- */
/* --------------------------------- */