Mathc initiation/Fichiers h : c51a6
Installer ce fichier dans votre répertoire de travail.
x_sdkr.h |
---|
/* ---------------------------------- */
/* save as x_sdkr.h */
/* ---------------------------------- */
double S_dkdr_t(
double (*P_h)(double r, double k),
double (*P_s)(double r),
double (*P_t)(double r),
int nk,
double r
)
{
pt2d p;
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.;}
p.y = ((*P_s)(r))+
i*(((*P_t)(r))-((*P_s)(r)))/nk;
p.x = r;
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)(r))-((*P_s)(r)))*M)
/ (3*nk) );
}
/* ---------------------------------- */
double S_dkdr(
double (*P_h)(double r, double k),
double (*P_s)(double r),
double (*P_t)(double r),
int nk,
double ar,
double br,
int nr
)
{
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.;}
M += m * S_dkdr_t((*P_h),
(*P_s),(*P_t),nk,
(ar + i*(br-ar)/nr));
}
return( ((br -ar)*M) / (3*nr) );
}
/* ---------------------------------- */
/* ---------------------------------- */
Déclaration des fichiers h.