Aller au contenu

Mathc initiation/Fichiers h : c40fa

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(sqrt(x));
}
char  feq[] = "x**(1./2.)";
/* ---------------------------------- */
double Df(
double x)
{
         return( 1./(2.*(sqrt(x))) );
}
char  Dfeq[] = "1./(2.*(x**(1./2.)))";
/* ---------------------------------- */
double ds(
double x)
{
     return(  sqrt(1.+ pow(Df(x),2) ) );
}
/* ---------------------------------- */
double SurfaceArea(
double x)
{
     return( 2. * PI * f(x) * ds(x) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fb.h
/* ---------------------------------- */
/* save as fb.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(x*x);
}
char  feq[] = "x**(2)";
/* ---------------------------------- */
double Df(
double x)
{
         return(2. * x);
}
char  Dfeq[] = "2. * x";
/* ---------------------------------- */
double ds(
double x)
{
     return(  sqrt(1.+ pow(Df(x),2) ) );
}
/* ---------------------------------- */
double SurfaceArea(
double x)
{
     return( 2. * PI * f(x) * ds(x) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fc.h
/* ---------------------------------- */
/* save as fc.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(sin(x));
}
char  feq[] = "sin(x)";
/* ---------------------------------- */
double Df(
double x)
{
         return(cos(x) );
}
char  Dfeq[] = "cos(x)";
/* ---------------------------------- */
double ds(
double x)
{
     return(  sqrt(1.+ pow(Df(x),2) ) );
}
/* ---------------------------------- */
double SurfaceArea(
double x)
{
     return( 2. * PI * f(x) * ds(x) );
}
/* ---------------------------------- */
/* ---------------------------------- */
fd.h
/* ---------------------------------- */
/* save as fd.h                       */
/* ---------------------------------- */
double f(
double x)
{
        return(exp(x));
}
char  feq[] = "exp(x)";
/* ---------------------------------- */
double Df(
double x)
{
         return(exp(x));
}
char  Dfeq[] = "exp(x)";
/* ---------------------------------- */
double ds(
double x)
{
     return(  sqrt(1.+ pow(Df(x),2) ) );
}
/* ---------------------------------- */
double SurfaceArea(
double x)
{
     return( 2. * PI * f(x) * ds(x) );
}
/* ---------------------------------- */
/* ---------------------------------- */