Mathc initiation/Fichiers h : c51a5
Installer ce fichier dans votre répertoire de travail.
x_sdrk.h |
---|
/* ---------------------------------- */
/* save as x_sdrk.h */
/* ---------------------------------- */
double S_drdk_t(
double (*P_h)(double r, double k),
double (*P_s)(double k),
double (*P_t)(double k),
int nr,
double k
)
{
pt2d p;
int i = 0;
double m = 0.;
double M = 0.;
for(i = 0; i <= nr; i++)
{
if(i ==0 || i== nr){m = 1.;}
else if(fmod(i,2) == 0 ){m = 2.;}
else {m = 4.;}
p.x = ((*P_s)(k))+
i*(((*P_t)(k))-((*P_s)(k)))/nr;
p.y = k;
M += m * (sqrt( pow(fxy_x((*P_h),H,p),2) +
pow(fxy_y((*P_h),H,p),2) +
1) *
p.x) ;
}
return( ((((*P_t)(k))-((*P_s)(k)))*M)
/ (3*nr) );
}
/* ---------------------------------- */
double S_drdk(
double (*P_h)(double r, double k),
double (*P_s)(double k),
double (*P_t)(double k),
int nr,
double ak,
double bk,
int nk
)
{
int i = 0;
double m = 0.;
double M = 0.;
for(i = 0; i <= nk; i++)
{
if(i ==0 || i== nk){m = 1.;}
else if(fmod(i,2) == 0 ){m = 2.;}
else {m = 4.;}
M += m * S_drdk_t((*P_h),
(*P_s),(*P_t),nr,
(ak+i*(bk-ak)/nk));
}
return( ((bk -ak)*M) / (3*nk) );
}
/* ---------------------------------- */
/* ---------------------------------- */
Déclaration des fichiers h.