Aller au contenu

Mathc initiation/Fichiers h : c41fa

Un livre de Wikilivres.


Sommaire


Installer ce fichier dans votre répertoire de travail.

Les fonctions f(x)
fa.h
/* ---------------------------------- */
/* save as fa.h                       */
/* ---------------------------------- */
double f(
double x)
{
         return(x*x  + 2.);
}
char  feq[] =  "x**2 + 2.";
/* ---------------------------------- */
double g(
double x)
{
         return(x/2. + 1.);
}
char  geq[] =  "x/2. + 1.";
/* ---------------------------------- */
double Vwasher(
double x)
{
        return(PI * ( pow(f(x),2) - pow(g(x),2) ) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fb.h
/* ---------------------------------- */
/* save as fb.h                       */
/* ---------------------------------- */
double f(
double x)
{
         return(-2.*x*x  + 2.);
}
char  feq[] =  "-2.*x**2 + 2.";
/* ---------------------------------- */
double g(
double x)
{
         return(-x*x  + 1.);
}
char  geq[] =  "-x**2 + 1.";
/* ---------------------------------- */
double Vwasher(
double x)
{
        return(PI * ( pow(f(x),2) - pow(g(x),2) ) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fc.h
/* ---------------------------------- */
/* save as fc.h                       */
/* ---------------------------------- */
double f(
double x)
{
         return(sin(x));
}
char  feq[] =  "sin(x)";
/* ---------------------------------- */
double g(
double x)
{
         return(x*x);
}
char  geq[] =  "x**2";
/* ---------------------------------- */
double Vwasher(
double x)
{
        return(PI * ( pow(f(x),2) - pow(g(x),2) ) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fd.h
/* ---------------------------------- */
/* save as fd.h                       */
/* ---------------------------------- */
double f(
double x)
{
         return(sqrt(x));
}
char  feq[] =  "x**(1./2.)";
/* ---------------------------------- */
double g(
double x)
{
         return(x*x);
}
char  geq[] =  "x**2";
/* ---------------------------------- */
double Vwasher(
double x)
{
        return(PI * ( pow(f(x),2) - pow(g(x),2) ) );
}
/* ---------------------------------- */
/* ---------------------------------- */