gem-graph-client/include/xfxy_x.h

71 lines
1.3 KiB
C

/* ------------------------------------------------------------------ */
/* gnuplot : xfxy_x.h */
/* https://fr.wikibooks.org/wiki/Mathc_gnuplot/Fichiers_h_:_xfxy_x */
/* ------------------------------------------------------------------ */
#include "xspv.h"
double fxy_x(
double (*P_f)(double x, double y),
double h,
point2d 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,
point2d 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 fxy_xx(
double (*P_f)(double x, double y),
double h,
point2d p
)
{
double t;
double tplsh;
double tmnsh;
t = ((*P_f)(p.x , p.y));
tplsh = ((*P_f)(p.x+h, p.y));
tmnsh = ((*P_f)(p.x-h, p.y));
return( (tplsh-2*t+tmnsh)/(h*h) );
}
/* ------------------------------------ */
double fxy_yy(
double (*P_f)(double x, double y),
double h,
point2d p
)
{
double t;
double tplsh;
double tmnsh;
t = ((*P_f)(p.x, p.y ));
tplsh = ((*P_f)(p.x, p.y+h));
tmnsh = ((*P_f)(p.x, p.y-h));
return( (tplsh-2*t+tmnsh)/(h*h) );
}