Mathc initiation/Fichiers h : c44a2
Installer ce fichier dans votre répertoire de travail.
kg_3dtx.h |
---|
/* --------------------------------- */
/* save as kg_3dtx.h */
/* --------------------------------- */
void G_3d_tx(
CTRL_splot p,
char feq[],
double (*P_f)(double x, double y),
pt2d Q,
double h
)
{
FILE *fp;
double a,b;
fp = fopen("a_main.plt","w");
fprintf(fp,"set isosamples 50\n");
//fprintf(fp,"set hidden3d\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_tan\" with linesp lt 1 pt 3,\\\n");
fprintf(fp," \"a_ka\" pt 20,\\\n");
fprintf(fp,"%s \n\n",feq);
fclose(fp);
fp = fopen("a_ka","w");
fprintf(fp," %6.3f %6.3f %6.3f\n",
Q.x, Q.y, ((*P_f)(Q.x,Q.y)) );
fclose(fp);
a=fxy_x((*P_f),h,Q);
b=((*P_f)(Q.x,Q.y)-fxy_x((*P_f),h,Q)*Q.x);
fp = fopen("a_tan","w");
for(Q.x=p.xmin; Q.x<p.xmax;Q.x+=0.2)
fprintf(fp," %6.3f %6.3f %6.3f\n",
Q.x,Q.y,a*Q.x+b);
fclose(fp);
}
/* --------------------------------- */
/* --------------------------------- */
Déclaration des fichiers h.