Mathc initiation/Fichiers c : c25cb
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;
pt2d p = i_pt2d(5.5,2.5);
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.9f with the equation\n\n",
p.x,p.y, f_x( p.x,p.y ));
printf(" f_x(%0.2f,%0.2f) = %0.9f with the formula \n\n",
p.x,p.y, fxy_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.9f with the equation\n\n",
p.x,p.y, f_y( p.x,p.y ));
printf(" f_y(%0.2f,%0.2f) = %0.9f with the formula \n\n",
p.x,p.y, fxy_y(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 - 2*x**2 * y + 3*x
f_x : x,y-> 3*x**2 * y**2 - 4*x * y + 3
f_x(5.50,2.50) = 515.187500000 with the equation
f_x(5.50,2.50) = 515.187500062 with the formula
Press return to continue.
Exemple de sortie écran :
f : x,y-> x**3 * y**2 - 2*x**2 * y + 3*x
f_y : x,y-> 2*x**3 * y - 2*x**2
f_y(5.50,2.50) = 771.375000000 with the equation
f_y(5.50,2.50) = 771.375000003 with the formula
Press return to continue.