Mathc initiation/a445
Installer ce fichier dans votre répertoire de travail.
x_ps_st.h |
---|
/* ---------------------------------- */
/* save as x_ps_st.h */
/* ---------------------------------- */
double paraSint_st(
double (*P_Rx)(double s, double t),
double (*P_Ry)(double s, double t),
double (*P_Rz)(double s, double t),
double (*P_f)(double x, double y, double z),
double (*P_u)(double y),
double (*P_v)(double y),
int nx,
double y
)
{
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)(y)) + i*(((*P_v)(y))-((*P_u)(y)))/nx;
p.y = y;
M += m * (*P_f)((*P_Rx)(p.x,p.y), (*P_Ry)(p.x,p.y), (*P_Rz)(p.x,p.y))
*
N_Rs_x_Rt((*P_Rx),(*P_Ry), (*P_Rz),
p);
}
return( ((((*P_v)(y)) -((*P_u)(y)))*M) / (3*nx) );
}
/* ---------------------------------- */
double parametricS_st(
double (*P_Rx)(double s, double t),
double (*P_Ry)(double s, double t),
double (*P_Rz)(double s, double t),
double (*P_f)(double x, double y, double z),
double (*P_u)(double y),
double (*P_v)(double y),
int nx,
double ay,
double by,
int ny
)
{
int i = 0;
double m = 0.;
double M = 0.;
for(i = 0; i <= ny; i++)
{
if(i ==0 || i== ny){m = 1.;}
else if(fmod(i,2) == 0){m = 2.;}
else {m = 4.;}
M += m * paraSint_st( (*P_Rx),(*P_Ry),(*P_Rz),
(*P_f),
(*P_u),(*P_v), nx,
(ay + i*(by-ay)/ny));
}
return( ((by -ay)*M) / (3*ny) );
}
/* ---------------------------------- */
/* ---------------------------------- */