Mathc initiation/Fichiers h : c24a4
Installer ce fichier dans votre répertoire de travail.
![]() |
x_f_x.h utilitaire |
---|
/* ---------------------------------- */
/* save as x_f_x.h */
/* --------------------------------- */
double fxy_x(
double (*P_f)(double x, double y),
double h,
pt2d p
)
{
double tplsh;
double tmnsh;
tplsh = ((*P_f)(p.x+h,p.y));
tmnsh = ((*P_f)(p.x-h,p.y));
return(( tplsh-tmnsh)/(2.*h) );
}
/* --------------------------------- */
double fxy_y(
double (*P_f)(double x, double y),
double h,
pt2d p
)
{
double tplsh;
double tmnsh;
tplsh = ((*P_f)(p.x,p.y+h));
tmnsh = ((*P_f)(p.x,p.y-h));
return(( tplsh-tmnsh)/(2.*h) );
}
/* --------------------------------- */
Dans ce fichier il y a les deux fonctions qui donnent les dérivées partielles d'une fonction f par rapport à x ou à y.
First partial derivatives.
f_x = [f(x+h,y)-f(x-h,y)]/2h
f_y = [f(x,y+h)-f(x,y-h)]/2h