Mathc initiation/Fichiers c : c26cb
Installer et compiler ces fichiers dans votre répertoire de travail.
c16b.c |
---|
/* --------------------------------- */
/* save as c16b.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fb.h"
/* --------------------------------- */
int main(void)
{
double h = .0001;
pt3d p = i_pt3d(0.5,0.2,0.3);
clrscrn();
printf(" f : x,y-> %s\n\n", feq );
printf(" f_x : x,y-> %s\n\n\n",Dfeq_x);
printf(" f_x(%0.2f,%0.2f,%0.2f) = %0.9f"
" with the equation\n\n",
p.x,p.y,p.z, f_x(p.x,p.y,p.z));
printf(" f_x(%0.2f,%0.2f,%0.2f) = %0.9f"
" with the formula \n\n",
p.x,p.y,p.z, fxyz_x(f,h,p));
stop();
clrscrn();
printf(" f : x,y-> %s\n\n", feq );
printf(" f_y : x,y-> %s\n\n\n",Dfeq_y);
printf(" f_y(%0.2f,%0.2f,%0.2f) = %0.9f"
" with the equation\n\n",
p.x,p.y,p.z, f_y(p.x,p.y,p.z));
printf(" f_y(%0.2f,%0.2f,%0.2f) = %0.9f"
" with the formula \n\n",
p.x,p.y,p.z, fxyz_y(f,h,p));
stop();
clrscrn();
printf(" f : x,y-> %s\n\n", feq );
printf(" f_z : x,y-> %s\n\n\n",Dfeq_z);
printf(" f_z(%0.2f,%0.2f,%0.2f) = %0.9f"
" with the equation\n\n",
p.x,p.y,p.z, f_z(p.x,p.y,p.z));
printf(" f_z(%0.2f,%0.2f,%0.2f) = %0.9f"
" with the formula \n\n",
p.x,p.y,p.z, fxyz_z(f,h,p));
stop();
return 0;
}
/* --------------------------------- */
Essayez avec h = .1, h = .01, h = .001, h = .0001, h = .00001 pour observer l'augmentation de la précision des calculs.
Exemple de sortie écran :
f : x,y-> x**3*y**2*z-x*y+z
f_x : x,y-> -y+3*x**2*y**2*z
f_x(0.50,0.20,0.30) = -0.191000000 with the equation
f_x(0.50,0.20,0.30) = -0.191000000 with the formula
Press return to continue.
Exemple de sortie écran :
f : x,y-> x**3*y**2*z-x*y+z
f_y : x,y-> -x+2*x**3*y*z
f_y(0.50,0.20,0.30) = -0.485000000 with the equation
f_y(0.50,0.20,0.30) = -0.485000000 with the formula
Press return to continue.
Exemple de sortie écran :
f : x,y-> x**3*y**2*z-x*y+z
f_z : x,y-> 1+x**3*y**2
f_z(0.50,0.20,0.30) = 1.005000000 with the equation
f_z(0.50,0.20,0.30) = 1.005000000 with the formula
Press return to continue.