Mathc initiation/Fichiers h : c28a5


Sommaire


Installer ce fichier dans votre répertoire de travail.

Crystal Clear mimetype source h.png 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) );
}
/* --------------------------------- */
/* --------------------------------- */
/* --------------------------------- */
double fxyz_x(
double (*P_f)(double x, double y, double z),
double   h,
pt3d  p
)
{
double tplsh;
double tmnsh;

 tplsh = ((*P_f)(p.x+h,p.y,p.z));
 tmnsh = ((*P_f)(p.x-h,p.y,p.z));

 return(( tplsh-tmnsh)/(2.*h) );
}
/* --------------------------------- */
double fxyz_y(
double (*P_f)(double x, double y, double z),
double   h,
pt3d  p
)
{
double tplsh;
double tmnsh;

 tplsh = ((*P_f)(p.x,p.y+h,p.z));
 tmnsh = ((*P_f)(p.x,p.y-h,p.z));

 return(( tplsh-tmnsh)/(2.*h) );
}
/* --------------------------------- */
double fxyz_z(
double (*P_f)(double x, double y, double z),
double   h,
pt3d  p
)
{
double tplsh;
double tmnsh;

 tplsh = ((*P_f)(p.x,p.y,p.z+h));
 tmnsh = ((*P_f)(p.x,p.y,p.z-h));

 return(( tplsh-tmnsh)/(2.*h) );
}
/* --------------------------------- */


Dans ce fichier il y a les fonctions pour calculer les dérivées partielles.

       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


       First partial derivatives.

f_x = [f(x+h,y,z)-f(x-h,y,z)]/2h

f_y = [f(x,y+h,z)-f(x,y-h,z)]/2h

f_z = [f(x,y,z+h)-f(x,y,z-h)]/2h