Mathc initiation/Fichiers h : c60a6
Apparence
Installer ce fichier dans votre répertoire de travail.
x_surfxz.h |
---|
/* ---------------------------------- */
/* save as x_surfxz.h */
/* ---------------------------------- */
double Sint_dxz(
double (*P_g)(double x, double y, double z),
double (*P_h)(double x, double z),
double (*P_u)(double z),
double (*P_v)(double z),
int nx,
double z
)
{
pt2d p;
int i = 0;
double m = 0.;
double M = 0.;
for(i = 0; i <= nx; i++)
{
if(i ==0 || i== nx){m = 1.;}
else if(fmod(i,2) == 0){m = 2.;}
else {m = 4.;}
p.x = ((*P_u)(z)) + i*(((*P_v)(z))-((*P_u)(z)))/nx;
p.y = z;
M += m * ( (*P_g)(p.x,(*P_h)(p.x,p.y),p.y) *
sqrt( pow(fxy_x((*P_h),H,p),2) +
pow(fxy_y((*P_h),H,p),2) +
1));
}
return( ((((*P_v)(z)) -((*P_u)(z)))*M) / (3*nx) );
}
/* ---------------------------------- */
double surface_dxdz(
double (*P_g)(double x, double y, double z),
double (*P_h)(double x, double z),
double (*P_u)(double z),
double (*P_v)(double z),
int nx,
double az,
double bz,
int nz
)
{
int i = 0;
double m = 0.;
double M = 0.;
for(i = 0; i <= nz; i++)
{
if(i ==0 || i== nz){m = 1.;}
else if(fmod(i,2) == 0){m = 2.;}
else {m = 4.;}
M += m * Sint_dxz( (*P_g),(*P_h),
(*P_u),(*P_v), nx,
(az + i*(bz-az)/nz));
}
return( ((bz -az)*M) / (3*nz) );
}
/* ---------------------------------- */
/* ---------------------------------- */
Déclaration des fichiers h.