Mathc initiation/a433
Apparence
Installer ce fichier dans votre répertoire de travail.
kg_cm.h |
---|
/* --------------------------------- */
/* save as kg_cm.h */
/* --------------------------------- */
void G_cmass(
CTRL_splot w,
char feq[],
pt3d XYZ
)
{
FILE *fp = fopen("a_main.plt","w");
fprintf(fp,"reset\n");
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",
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_kb\" with linespoints lt 7,\\\n");
fprintf(fp," %s,\\\n",feq);
fprintf(fp," \"apoint\" lw 6 lt 7 pt 7\n");
fclose(fp); /* __________ */
/* | | */ /* xi ym xm ym */
fp = fopen("a_kb","w"); /* |__________| */ /* xi yi xm yi */
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmin, w.ymin, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmax, w.ymin, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmax, w.ymax, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmin, w.ymax, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmin, w.ymin, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmax, w.ymax, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmin, w.ymax, w.zmin);
fprintf(fp," %6.3f %6.3f %6.3f\n",
w.xmax, w.ymin, w.zmin);
fclose(fp);
fp = fopen("apoint","w");
fprintf(fp," %6.3f %6.3f %6.3f\n",
XYZ.x, XYZ.y, XYZ.z );
fclose(fp);
printf(" ... load \"a_main.plt\" ... with gnuplot.\n\n");
}
/* --------------------------------- */
/* --------------------------------- */
----